C++ Programming: Namiq Sultan
C++ Programming: Namiq Sultan
Namiq Sultan
University of Duhok
Department of Electrical and Computer Engineering
www.sites.google.com/site/namiqsultan
2011-2012
1
Chapter 1. Introduction to Computers and
Programming
Central Processing
Input
Unit (CPU)
Device
Output
Device
Main
Memory
Secondary
Storage
Device
Instruction
(Input) Result
Arithmetic and (Output)
Logic Unit
Control
Unit
• What is a program?
– A set of instructions a computer follows in order to
perform a task.
• A programming language is a special language used to
write computer programs.
Read hours
Display message
”How much do you get paid per
hour?”
Read rate
Display pay
END
High level
(Close to Human Language)
Low level
(Machine Language)
• Input:
cin >> hours;
• Processing:
pay = hours * rate;
• Output
cout << "You have earned $" << pay;