Chapter 2
Introduction to Programming Languages
Software
"Software is a set of programs (sequence of instructions) that allows the users to perform a well-defined
function or some specified task."
Types of Software
Software's are broadly classified into two types, i.e., System
Software and Application Software.
System Software
◦ System software is a computer program that helps the user to run
computer hardware or software and manages the interaction between
them.
◦ Essentially, it is software that constantly runs in the computer
background, maintaining the computer hardware and computer's basic
functionalities, including the operating system, utility software, and
interface.
◦ In simple terms, you can say that the system acts as a middle man that
checks and facilitates the operations flowing between the user and the
computer hardware
Types of System Software
Operating System
◦ The operating system is the most prominent example of system software that acts as an
interface between the user and system hardware.
◦ It is a group of software that handles the execution of programs and offers general
services for the application that runs over the computer.
◦ There are various types of operating systems available in the market, such as embedded
operating systems, real-time OS, distributed OS, single or multi-user operating system, mobile,
Internet, and various others.
Examples of operating systems are given below.
◦ Microsoft Windows
◦ Apple's iOS
◦ Apple's MacOS
◦ Android
◦ CentOS
◦ Linus
◦ Ubuntu
◦ Unix
Device Drivers
In computing, the device driver is a type of software that operates or
controls some specific hardware devices linked to your system.
They provide a software interface to hardware devices allowing computer
operating systems and other applications to fetch hardware functions
without knowing the exact specifications of the hardware.
Some common examples of such device drivers that connect hardware
devices (printers, sound cards, network cards, hard disks, floppy disk,
keyboard, mouse, etc.) to a system easily are as follows:
◦ USB (Universal Serial Bus) Drivers
◦ Motherboard Drivers
◦ Display Drivers
◦ Printer Drivers
◦ Sound Card Driver
◦ ROM (Read-only memory) Drivers
◦ VGA (Video Graphic Array) Drivers
Application Software
Application programs or software applications are end-user computer
programs developed primarily to provide specific functionality to the user.
The applications programs assist the user in accomplishing numerous tasks such as
doing online research, completing notes, designing graphics, managing the
finances, watching a movie, writing documents, playing games, and many
more
Word Processors
MS Word (Microsoft)
iWork-Pages (Apple)
Corel WordPerfect
Google Docs
Database Software
Oracle
MS Access
SQLite
Microsoft SQL Server
Web Browsers
These are a type of software that is globally used to browse
the Internet.
Web browsers help the users in positioning as well
as fetching data across the web.
Chrome
Mozilla Firefox
Microsoft Internet Explorer
Opera
Microsoft Edge
Why Programming?
“Everybody in this country should learn how to program a
computer… because it teaches you how to think”
- Steve Jobs
Automating the tasks
Saving time to perform any task
Minimize errors
Provide better experience to users
Why Programming languages?
Provide set of instructions used by humans to interact
with the computer
Develop various applications like Web Applications,
Games, Mobile applications, System applications etc
Programming Languages:
It is a tool to communicate with the computer
Allows to write set of instructions to the computer known as
program.
Computer Language
Low Level High Level Language
Machine Language Assembly Language
Machine Language:
Computer understands the Binary language i.e. 0’s and 1’s
So the programs were written in the form of 0 and 1 to communicate with the computer
Computers could easily understand these program and can be directly executed.
As it is already in binary format, no translation is required, hence executed very fast
But this language is difficult to understand
Writing a machine language program is very difficult
They are completely dependent on the machine and are not portable.
Assembly Language:
Developed to overcome disadvantages of Machine Language to some extent
Small English words like ADD, SUB, MULT, DIV etc were introduced to specify the
instructions to the machine. These words are called mnemonics
Writing a program was easier than the machine language
Programs were easy to understand
Computer cannot understand these mnemonics, so a special translator called Assembler
is required to translate the assembly code to machine code
High Level Language:
Developed to overcome disadvantages of the low-level languages
These languages are more English-like having their own set of rules
As they are very similar to natural languages, they are easy to use and understand
Programs in high level language are easier to write than the low level language
But these programs need to be converted to machine language using special
software's called Compilers and Interpreters
Compilers and Interpreters
Used to translate high level program into low level program
Low level
High level
Compiler/Interpreter language program
language program
(Machine
(Source Code)
Code/Object
Code)
Problem Solving?
Problem-solving is using methods or steps in a sequential/orderly manner
to find solutions to a problem
There is a four-step approach for problem solving
Understand the problem
1. Understand the problem
Design a plan
2. Design a plan to solve the problem
3. Implement the designed plan
Implement the plan
4. Look back and review
Look back
Algorithm
Algorithm is an important tool to design and develop a step by step
solution to a problem
Definition:
An algorithm is a finite set of instructions in a specific sequence
which accomplishes a particular task.
These instructions are written in simple plain languages as English
Properties of an Algorithm:
1. Finiteness: The algorithm should have finite number of steps.
2. Definiteness: Each instruction in the algorithm should be clear
and unambiguous
3. Effectiveness: Every instruction should be basic and essential.
4. Input: It must accept zero or more input quantities
5. Output: It must produce one or more outputs
Flowchart
Definition:
A flowchart is a diagrammatic or pictorial representation of an algorithm
Easy to understand
Easy to identify errors
Flow of data can be easily understood
Modifying flowchart can be very difficult
It is time-consuming
Important Symbols:
Symbol Name Use
Terminal Used for Start or Stop
Input/Output Used for Input or Output purpose
Contains the arithmetic, assignment and all the
Process Box
other operations
Checks for conditions and has two or more
Decision Box
alternatives based on the decision
Flow lines Shows the direction of the flow
Used to connect different flow lines or continuity of
Connector
the flowchart
References:
1. Programming in ANSI C, E Balagurusamy
2. www.javatpoint.com