Computer Programming1 Lecture1
Computer Programming1 Lecture1
Control Unit
Input Output
device Device
Arithmetic/Logic
Unit
Memory Unit My My
data Progam
Computer Organization
• Outputs
– Can also take on many forms, such as
numbers, text, graphics, sounds, or
commands to other programs
Example
Area and Perimeter
1 of a
rectangle
• Input
– Length
– width
• Processing
– Area = length*width
– Perimeter = 2*( length +
width)
• Output
– Area
– Perimeter
Example
Sum and 2
Average of 5
numbers
• Input
– five number x1, x2, x3,
x4, x5
• Processing
– Sum = x1+x2+x3+x4+x5
– Average = Sum/5
• Output
– Sum
– Average
Example
Area and3Perimeter of a
circle
• Input
– Radius
– PI
• Processing
– Area = PI * Radius *
Radius
– Perimeter = 2 * PI *
Radius
• Output
– Area
– Perimeter
Planning the Solution