Leccture 01
Leccture 01
Lecture 1
Aamina Batool
What is a computer?
1. Hardware
Central Processing Unit (CPU)
Main Memory
Secondary Storage
Input/ Output Devices
2. Software
Central Processing Unit (CPU)
1. CU (Control Unit):
Fetches and decodes instructions
3. Registers:
All programs must be loaded into main memory before they can be
executed
Design algorithm:
1. Get length of Rectangle.
2. Get width of Rectangle.
3. Find the perimeter using the following equation:
Perimeter = 2 . (length + width)
Sample Run:
My first C++ program.
The sum of 2 and 3 = 5
7 + 8 = 15
Pre-processing a Program