Standard Version Of: Starting Out With C++, 4th Edition
Standard Version Of: Starting Out With C++, 4th Edition
Chapter 1
Introduction to Computers and
Programming
Copyright 2003
Scott/Jones Publishing
Contents
Chapter 1 slide 3
1.2 Computer Systems:
Hardware and Software
Main Hardware Component Categories:
Chapter 1 slide 4
Main Hardware Component
Categories
Central
Processing
Unit
Input Output
Device Device
Main
Memory
Secondary
Storage
Devices
Chapter 1 slide 5
Central Processing Unit (CPU)
Comprised of:
Control Unit
Retrieves and decodes program instructions
Coordinates activities of all other parts of computer
Arithmetic & Logic Unit
Hardware optimized for high-speed numeric calculation
Hardware designed for true/false, yes/no decisions
Chapter 1 slide 6
Main Memory
Chapter 1 slide 7
Secondary Storage
Chapter 1 slide 8
Input Devices
Chapter 1 slide 9
Output Devices
Chapter 1 slide
10
Software – Programs That
Run on a Computer
Categories of software:
Operating system: programs that manage
the computer hardware and the programs
that run on them. Ex: Windows, UNIX,
Linux
Application software: programs that
provide services to the user. Ex: word
processing, games, programs to solve
specific problems
Chapter 1 slide 11
1.3 Programs and
Programming Languages
Program: a set of instructions to a
computer to perform a task
Chapter 1 slide
12
Programs and
Programming Languages
Types of languages:
Preprocessor Linker
Compiler
Chapter 1 slide
15
1.4 What Is a Program Made
Of?
Common elements in programming languages:
Key Words
Programmer-Defined Symbols
Operators
Punctuation
Syntax
Chapter 1 slide
16
Example Program
#include <iostream>
#include <string>
using namespace std;
int main()
{
string name;
cout << "What is your name? ";
cin >> name;
cout << "Hello there, " << name;
return 0;
}
Chapter 1 slide
17
Key Words
Chapter 1 slide
18
Programmer-Defined Symbols
Chapter 1 slide
19
Operators
Chapter 1 slide
20
Punctuation
Chapter 1 slide
21
Syntax
Chapter 1 slide
22
1.5 Input, Processing, and
Output
Three steps many programs perform:
1) Gather input data:
2) from keyboard
3) from files on disk drives
4) Process the input data
5) Display the results as output:
6) send it to the screen
7) write to a file
Chapter 1 slide
23
1.6 The Programming Process
Chapter 1 slide
25
1.7 Procedural and Object-
Oriented Programming
Procedural programming: focus is on the
process. Procedures/functions are
written to process data.
Object-Oriented programming: focus is on
objects, which contain data and the
means to manipulate the data. Messages
sent to objects to perform operations.
Chapter 1 slide
26
Standard Version of
Starting Out with C++, 4th
Edition
Chapter 1
Introduction to Computers and
Programming
Copyright 2003
Scott/Jones Publishing