Professional Documents
Culture Documents
1 What Is Programming PDF
1 What Is Programming PDF
1 What Is Programming PDF
Definitions
Program
A set of directions telling a computer exactly what
to do.
Programming languages
Languages for specifying sequences of directions
to a computer.
Algorithm
A sequence of language independent steps
which may be followed to solve a problem.
Flowchart
Diagrammatic representation of step for solving
the given problem.
2
Sample Algorithm
Calculating area of the circle.
Algorithm:
1.
2.
3.
4.
5.
Start.
Input radius in cm.
Calculate, area = 3.14 * (radius * radius)
Display area.
Stop
Sample Algorithm
Calculate the division obtained by the student according
to inputted marks.
1. Start.
2. Accept five different subjects marks,
i.e. m1, m2, m3, m4, m5.
3. Calculate, per = (m1+m2+m3+m4+m5) / 5
4. If per>= 75 then display Distinction else
If per>= 60 then display First class else
If per>= 50 then display Second class else
If per>= 40 then display Pass class else
Display Fail.
5. Stop.
5
General Processing
Decision
Input / Output
Connector
Function / Subroutine
6
Input radius
in cm.
Calculate area =
3.14 * (radius * radius)
Display
area
Stop
Start
Yes
per >=75
No
Yes
per >=60
No
Yes
per >=50
No
per >=40
Yes
Display
Distinction
Display
First Class
Display
Second
Class
Display
Pass Class
No
Display
Fail
Stop
8
Programming Languages
Machine language:
It is computers native language having a sequence of zeroes
and ones (binary). Different computers understand different
sequences. Thus, hard for humans to understand: e.g. 0101001...
Assembly language:
It uses mnemonics for machine language. In this each instruction
is minimal but still hard for humans to understand:
e.g. ADD AH, BL
High-level languages:
FORTRAN, Pascal, BASIC, C, C++, Java, etc.
Each instruction composed of many low-level instructions,
closer to English. It is easier to read and understand:
e.g. hypot = sqrt(opp*opp + adj * adj);
10
11
Coding into C
Design
Gathering requirement
and specifications
Implementation
Algorithm and
flowchart
Keep program
Working &
Current
Testing
Checking the
program execution and
debugging
Maintenance
Result: Working Program
12
Errors
13
Created By,
14