Introduction to Computers and C++ Programming
1
What is Computer?
Computer Organization
Computer Languages
C++
Your First Program in C++
Variables and Operators
Computer Programming
(HKU SPACE HDIT 10/11)
2
Computer Programming
(HKU SPACE HDIT 10/11)
3
Computer
◦ Device capable of performing two major functions
1.
2.
Computations
Making logical decisions
Computer programs
Hardware
◦ Sets of instructions used by computers to process data
◦ Various devices comprising computer
Keyboard, monitor, mouse, disks, DVD-ROM, processing units, etc.
Software
◦ Programs that run on computer, i.e., sets of instructions to command computer to perform actions and make decisions ◦ Computer programs are subset of software
Computer Programming
(HKU SPACE HDIT 10/11)
4
Six logical units of computer
1. Input unit
“Receiving” section
Obtains information from input devices
Keyboard, mouse, microphone, scanner, networks, etc.
2. Output unit
“Shipping” section
Takes information processed by computer
Places information on output devices
Screen, printer, networks, etc.
Information may be used to control other devices
(becomes input of other devices)
Computer Programming
(HKU SPACE HDIT 10/11)
5
3. Memory unit
“Warehouse” section
Rapid access, relatively low capacity
Retains information from input unit
Immediately available for processing
Retains processed information
Until placed on output devices
E.g., Random Access Memory (RAM)
4. Arithmetic and logic unit (ALU)
“Manufacturing” section
Performs arithmetic calculations and logic decisions
Computer Programming
(HKU SPACE HDIT 10/11)
6
5. Central processing unit (CPU)
“Administrative” section
Supervises and coordinates other sections of computer 6. Secondary storage unit
Long-term, high-capacity “warehouse”