Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1 Getting Acquainted With Computers, Programs, and C++

Similar presentations


Presentation on theme: "Chapter 1 Getting Acquainted With Computers, Programs, and C++"— Presentation transcript:

1 Chapter 1 Getting Acquainted With Computers, Programs, and C++

2 Chapter 1 A Typical PC

3 Chapter 1 The Hardware

4 Chapter 1 The Central Processing Unit (CPU) The central processing unit (CPU) is the brain and nerve center of the entire system. This is where all of the calculations and decisions are made. In a PC system, the entire CPU is contained within a single integrated circuit (IC) chip called a microprocessor.

5 Chapter 1

6 Typical Operations Performed by the ALU Addition + Subtraction  Multiplication* Division/ Modulus (Remainder)% Equal to== Not equal to!= Less than< Less than or equal to<= Greater than> Greater than or equal to>=

7 Chapter 1 Primary Memory Primary memory often is called main working memory. The reason for this is that primary, or main, memory is used to store programs and data while they are being “worked,” or executed, by the CPU.

8 Chapter 1 Binary Values bit0 or 1 byte8 bits kilobyte(KB)1024 bytes megabyte(MB)1,048,576 bytes gigabyte(GB)1,073,741,824 bytes

9 Chapter 1

10 Secondary Memory Secondary memory, sometimes called bulk or mass storage, is used to hold programs and data on a semi-permanent basis. The most common types of secondary memory used in PC systems are magnetic disks and CDs.

11 Chapter 1 Input Input is what goes into the system. Input devices are hardware devices that provide a means of entering programs and data into the system. The major input devices for a PC system are the keyboard, mouse, and disk drive.

12 Chapter 1 Output Output is what comes out of the system. Output devices are hardware devices that provide a means of getting data out of the system. The four major output devices with which you will be concerned are the display monitor, printer, disk drive, and modem.

13 Chapter 1 Loading and Saving Your C++ Programs

14 Chapter 1 The Fetch/Execute Cycle The fetch/execute cycle is what takes place when you run a program.

15 Chapter 1 The Software Computer software can be likened to the driver of an automobile. Without the driver, nothing happens. In other words, the computer hardware by itself can do nothing. A set of software instructions that tells the computer what to do is called a computer program.

16 Chapter 1 Machine Language All of the hardware components in a computer system, including the CPU, operate on a language made up of binary 1’s and 0’s. A CPU does not understand any other language.

17 Chapter 1 Assembly Language Assembly language employs alphabetic abbreviations called mnemonics that are easily remembered by you, the programmer. For instance, the mnemonic for addition is ADD, the mnemonic for move is MOV, and so forth.

18 Chapter 1 Operating Systems An operating system, or OS, is the “glue” that binds the hardware to the application software. Actually, an operating system is a collection of software programs dedicated to managing the resources of the system.

19 Chapter 1 High-Level Language A high-level language consists of instructions, or statements, that are similar to English and common mathematical notation. When programming in a high- level language, you do not have to concern yourself with the specific instruction set of the CPU. Rather, you can concentrate on solving the problem at hand.

20 Chapter 1 Language Translation A source program is the one that you write in the C++ language and that normally has a file extension of.cpp. An object program is the binary machine language program generated by the C++ compiler, which always has a file extension of.obj.

21 Chapter 1 C++ Translation

22 Chapter 1 Structured vs. Object-Oriented Languages The C language is a structured language that allows complex problems to be solved using a modular, top/down, approach. The C++ language contains the C language for structured programming, but in addition extends the C language to provide for object-oriented programming (OOP).

23 Chapter 1 Object-oriented programming (OOP) allows complex problems to be solved using more natural objects that model the way we humans think about things.

24 Chapter 1 Hello World /* NAME: ANDREW C. STAUGAARD JR. CLASS: CS1 PROGRAM TITLE: HELLO WORLD DATE: 5/16/01 THIS PROGRAM WILL DISPLAY THE MESSAGE "Hello World" TO THE SYSTEM MONITOR */ //PREPROCESSOR SECTION #include //FOR cout //MAIN FUNCTION SECTION int main() { //BEGIN MAIN FUNCTION BLOCK cout << "Hello World"; //DISPLAY MESSAGE TO MONITOR return 0; } //END MAIN FUNCTION BLOCK


Download ppt "Chapter 1 Getting Acquainted With Computers, Programs, and C++"

Similar presentations


Ads by Google