Chapter 1
Chapter 1
Chapter 1
05/22/2023 1
What is a Computer?
05/22/2023 2
Cont..
05/22/2023 3
Basic components of a computer system
05/22/2023 4
Cont..
♦Input unit: Obtains information (data and computer progr
ams) from input devices .
♦Output unit: This takes information that the computer has
processed
♦Memory:
Stores computer programs while they are being executed.
♦Central processing unit (CPU): This coordinates and
supervises the operation of the other section.
♦Arithmetic and logic unit (ALU): This unit is responsibl
e for performing calculations.
♦ Control Unit: Controls the operation of CPU, hence the
computer.
05/22/2023 5
What is programming?
05/22/2023 7
What is programming language?
05/22/2023 8
What skills do we need to be a programmer?
05/22/2023 10
Generations of programming language
Programming Language
3rd
1 Generation
st 2 nd
Generation 5th Generation
Generation
4th Generation
05/22/2023 11
.
1 First Generation (Machine languages, 1940’s )
05/22/2023 12
2.Second Generation (Assembly languages, early 1950’s)
05/22/2023 13
3. 3rd Generation (High level languages, 1950-
1970)
♦Use English like instruction and includes human language &
mathematical notations
♦ Have different syntax rules and take considerable time to
learn.
♦ Compilers and interpreters are needed for translation
♦They have (common words) which make them easier to learn
♦ Are procedural (It contains a systematic order of statements,
functions and commands to complete a computational task or
program).
♦It specifies a series of well-structured steps and procedures
within its program.
Example- C, C++, C# , Java and Pascal
05/22/2023 14
4.Fourth Generation (since late 1970’s)
♦Use English like syntax rules, but they are non
procedural (like ordering a meal).
♦Users concentrate on defining the input and output
rather than the program steps required
♦Less control over tasks (you don’t know how each task
is performed)
♦ They need more processing speed.
♦The difference is not that mach form the third
Example: Query languages e.g. SQL
05/22/2023 15
5.Fifth Generation (1990’s)
05/22/2023 16
Problem Solving Using Computers
♦Problems:
The gap between the existing and the desired situation
05/22/2023 17
Problem- Solving
05/22/2023 18
There are two approaches of problem solving:
Top-down design:
♦In Top-down Model, the focus is on breaking the bigger problem into
smaller one and then repeat the process with each problem
05/22/2023 20
Advantages of Top-Down Approach
05/22/2023 22
Cont..
05/22/2023 23
Basic Program Development Tips
05/22/2023 24
Cont..
Maintainable: the program should be in a way that it
could be modified and upgraded
Portable: it needs to be possible to adept the software
written for one type of computer to another with
minimum modification
Efficient: the program should be designed to make
optimal use of time, space and other resources.
05/22/2023 25
Software Engineering
05/22/2023 26
Software development method
05/22/2023 27
Software development method
05/22/2023 28
Software development method
05/22/2023 29
Software development method
05/22/2023 33
Characteristics of good algorithm
♦Efficient in time and memory
♦Precise and unambiguous
♦Finiteness : An algorithm must always terminate
♦Definiteness : Each step of an algorithm must be precisely
defined.
♦Narrative
♦Structured English
♦Pseudo Code
♦Flow chart
♦Program
05/22/2023 35
Narrative
05/22/2023 37
Pseudo code
05/22/2023 38
Flow chart
05/22/2023 39
Flow chart symbols
05/22/2023 40
Cont..
05/22/2023 41
Cont..
05/22/2023 42
Program (in C++)
05/22/2023 45
Individual Assignment one_10%
1. Develop flowchart used to find the maximum number of
the three numbers.
2. Develop a flow chart that used to find the sum of even
numbers.
3. Take an integer from the user and display the factorial of
that number
4. Draw a flowchart for check a given number is prime or
not.
5. Draw a flowchart to Print Hello World 10 times.
6. Draw a flowchart to log in to Facebook account.
7. Find all the roots of a quadratic equation ax2+bx+c=0
8. Find the Fibonacci series till term≤1000.
05/22/2023 46