? 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 0 - 1
Chapter 0
Introduction to Computers
and
Programming Languages
2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 0 - 2
Chapter 0 Objectives
After you have read and studied this chapter,you
should be able to
State briefly a history of computers.
Name and describe four major components of the
computer.
Convert binary numbers to decimal numbers and vice
versa.
State the difference between the low-level and high-level
programming languages.
2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 0 - 3
A History of Computers
Charles Babbage is credited as the father of computer,Although
never actually built,he proposed the computing machines called
Difference Engine and Analytical Engine that possessed the core
characteristics of today’s computers,
Ada Lovelace,who wrote demonstration programs for Analytical
Engine,is credited as the first programmer.
The first modern computer was built by Atanasoff of Iowa State
University in the late 1930s.
An electromechanical computer MARK I was built by Howard
Aiken of Harvard.
The first completely electronic computer ENIAC I was built by
Mauchly and Eckert of the University of Pennsylvania.
2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 0 - 4
Computer Architecture
CPU
Output
Devices
Commu-
nication
Devices
Input
Devices
RAM
Storage
Devices
2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 0 - 5
Progress of CPU Speed
For more information on Intel CPUs,
you can visit
Intel Museum or
Quick Reference Chart.
2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 0 - 6
Decimal Number Representation d e c i m a lp o i n t
10 110 210 310 4 10 0 10? 1 10? 2 10? 3
P o s i t i o n V a l u e s
How the decimal
number is represented.
10 110 2 10 0 10? 1
2 4 8 7
= 2? 1 0
2
+ 4? 1 0
1
+ 8? 1 0
0
+ 7? 1 0
1
= 2? 1 0 0 + 4? 1 0 + 8? 1 + 7? 1 / 1 0
= 2 0 0 + 4 0 + 8 + 7 / 1 0 = 2 4 8,7
Example:
2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 0 - 7
Binary Number Representation
b i n a r y
p o i n t
2 12 22 32 4 2 0 2? 1 2? 2 2? 3
P o s i t i o n V a l u e s
How the binary number
is represented.
= 1? 2
2
+ 0? 2
1
+ 1? 2
0
+ 1? 2
1
= 1? 4 + 0? 2 + 1? 1 + 1? 1 / 2
= 4 + 0 + 1 + 1 / 2 = 5,5
2
1
2
2
2
0
2
1
1 0 1 1
Example:
2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 0 - 8
Programming Languages
Three levels of programming languages:
Machine Languages
Machine language instructions are binary coded and very
low level.
Assembly Languages
Assembly language allows symbolic programming,
Requires an assembler to translate assembly programs into
machine programs.
High-level Languages
High-level language provides a very high conceptual model
of computing,Requires a compiler to translate high-level
pograms into assembly programs.
2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 0 - 9
Java
Java is a high-level object-oriented language
developed by Sun Microsystems.
Two types of Java programs:
An applet runs within a web browser
An application is a complete stand-alone program that
does not require a web browser.
Java’s clean design and wide availability make it an
ideal language for teaching the fundamentals of
computer programming.