Professional Documents
Culture Documents
Introduction To Computers and Programming
Introduction To Computers and Programming
Introduction to
Computers and
Programming
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Topics
1.1 Why Program?
1.2 Computer Systems: Hardware and
Software
1.3 Programs and Programming Languages
1.4 What Is a Program Made of?
1.5 Input, Processing, and Output
1.6 The Programming Process
1.7 Procedural and Object-Oriented
Programming
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1-2
1.1 Why Program?
Computer – programmable machine designed to
follow instructions
Program – instructions in computer memory to
make it do something
Programmer – person who writes instructions
(programs) to make computer perform a task
Central
Stream of bytes Processing Stream of bytes
Unit
Input Output
Device Device
Main
Memory
Secondary
Storage
Devices
• Byte
– Is 8 consecutive bits 0 1 1 0 0 1 1 1
• Word or int
– Usually 4 consecutive bytes
– Address is the 'first' byte 1 byte
• Application software
– programs that provide services to the user.
Ex: word processing, games, programs to solve
specific problems
Source Code
Object Code
Preprocessor
Linker
Modified
Source Code
Executable Code
Compiler
– Key Words
– Programmer-Defined Symbols
– Operators
– Punctuation
– Syntax
int main()
{
string name;
cout << "What is your name? ";
cin >> name;
cout << "Hello there, " << name;
cout << "2+2= " << 2+2 << endl;
return 0;
}
• Object-Oriented programming
– Focus is on objects, which contain data and
the means to manipulate the data
– Messages are sent to objects to perform
operations