Slide 1 - Flowchart-Compiler-Interpreter - Copy
Slide 1 - Flowchart-Compiler-Interpreter - Copy
Lesson 1 -
Introduction
Md. Muktar Hossain
Lecturer
Dept. of Computer Science and Engineering
Varendra University
In this Class
Structured Programming Language
Why C is Structured Programming
Language
Importance of C
Features of C
How to develop a program
Algorithm
Flow Chart
History of Programming Language
Translator
Structured Programming Language
Algorithm
1. Start
2. Read n1.
3. Read n2.
4. Calculate Sum = n1 +
n2.
5. Write the sum.
6. Stop.
Flow Chart
Very popular method to represent the
steps of the solution.
Uses many graphical symbols and thus,
is more understandable.
The symbols used for various different
types of statements/steps.
Flow Chart Start
Print Sum
Stop
Flowchart Symbols
Beginning or end
oval START
of program
Read n
Parallelogra or
m Input or Output
Print n
Direction of logic
flow
Flowchart Symbols
Rectangular
Processing Sum = a+b
Connector
Write a program to add two numbers
Start
Read n1
Algorithm Read n2
1. Start
2. Read n1.
3. Read n2. Sum = n1 + n2
4. Calculate Sum = n1 +
n2.
5. Write the sum.
Print Sum
6. Stop.
Stop
Write a program to find bigger one between two
numbers
Start
Read n1
Algorithm Read n2
1. Start
2. Read n1. Yes No
if
3. Read n2. n1 >
4. If n1>n2. n2
print n1 is ?
bigger Print n1 Print n2
5. else
print n2 is
bigger
6. Stop. Stop
Write a program to Find Sum of first n
numbers Start
Read n
Algorithm i=1
1. Read n. Sum = 0
2. Initialize i=1.
3. Initialize sum, Sum=0. Sum = Sum + i
4. Calculate, Sum = Sum+i. i = i+1
5. Calculate, i = i+1. No
6. If i>n, then goto step 7 else goto step 4. If i >
7. Write the sum Sum. n?
8. Stop. Yes
Print sum
Stop
History of Programming Language
Computer Programming
Computer programming is the process of designing,
writing, testing, debugging and maintaining the source
code of computer programs.
This source code is written in one or more programming
languages (such as C++, C#, Java, Python, Smalltalk, etc.).
Type of Programming Language
• Machine languages
• Assembly languages
• Higher-level languages
Machine Languages
• Machine languages (first-generation languages) are the most basic type of
computer languages, consisting of strings of numbers the computer's hardware
can use.
• Different types of hardware use different machine code. For example, IBM
computers use different machine language than Apple computers
Machine Languages : 83+(-2)
Machine Languages : 83+(-2)
Assembly Languages
• Assembly languages (second-generation languages) are only somewhat easier to
work with than machine languages.
• The code is then translated into object code, using a translator called an
assembler.
Assembly Languages : 83+(-2)
Assembly Languages : 83+(-2)
Assembly
code
Assembler
Object code
Higher-Level Languages
Higher-level languages are more powerful than assembly language and allow
the programmer to work in a more English-like environment.
• Third-generation languages
• Fourth-generation languages
• Fifth-generation languages
High Level Language : 83+(-2)
Translator
Translators are just computer programs which
accept a program written in high level or low
level language and produce an equivalent
machine level program as output. Translators
are of three types:
Assembler
Compiler
Interpreter
Assembler