Welcome to Object-Oriented Programming Using Java... 1/4 Subject aims To understand how computers work To develop techniques for solving problems using a computer To develop skil
Trang 1Welcome to Object-Oriented Programming
Using Java
Trang 3► Subject Information
Trang 41/4
Subject aims
To understand how computers work
To develop techniques for solving problems using a computer
To develop skills in algorithm development
and object-oriented programming using the
Java language
To gain experience in engineering reliable
programs
Trang 5… in particular
OOJ/OJA and IPJ/IJA have been designed
to form the core of Java programming
They provide a solid foundation for Java
application development
Trang 61/6
Teaching philosophy
Learning is an active process
The role of the teaching staff is to assist
students to learn
Students must be driven and
self-managed
Learning in groups is a positive experience
Problem solving and programming are best
learnt by practice
Trang 7References
Textbook
– Walter Savitch, Java: An Introduction to Computer
Science & Programming (Third Edition), Pearson, 2004
– Harley Hahn, Student Guide to Unix, McGraw-Hill, 1996
– Steve Oualline, Vi IMproved – Vim, New Riders, 2001
( http://www.newriders.com/books/opl/ebooks/0735710015.html )
Trang 81/8
What is expected from you?
An interest in the material
Participation in labs and lectures
Be aware of the learning environment you
share with other students
– No disruptive behaviour
Trang 9Overview of OOJ/OJA
Introduction to Computer Systems,
– Unix Environment and Java Programming
Primitive Data Types
Trang 101/10
►Computer Systems and
Structure
Trang 11What is a computer?
A computer is a device for storing and
processing information
When connected to networks, a computer
becomes a versatile communication tool
When connected to other devices, a
computer can act as a sophisticated
device-controller
Java provides facilities to write programs to
Trang 121/12
Hardware and software
A computer consists of hardware and
software
Hardware consists of the physical
components that make up the computer
Software consists of programs that control
the hardware to do useful work
Programming (or coding) is the process of
writing software
Trang 13Examples of hardware
Trang 141/14
Typical components in a PC
CD-ROM drive
Disk drives
Trang 15Main hardware components
CPU - Central Processing Unit
– Executes program instructions
RAM - Internal memory
– Stores programs that are currently being run and data
associated with those programs
– Volatile
I/O (Input/Output) devices
– Allow information to be input to the computer (e.g
keyboard, mouse, scanner)
– Allow information to be output by the computer (e.g
Trang 161/16
Main hardware components
Secondary storage (or external memory)
– Disk, tape, CD-ROM
– Larger, slower, cheaper than internal memory
– For storage of programs and data not currently
in use
Bus
– Transmits data and instructions between the
CPU and memory
– n address bits means we can address 2 n memory
locations labelled 0 to 2n - 1
Trang 17Terminology and functionality
Files and directories
– Ways of storing and organising data and
programs on secondary storage
– Covered in detail in laboratory classes
Peripheral devices
– Collective name for secondary storage and I/O
devices
Trang 19Binary representation
Inside the computer, data and instructions
are represented as bit patterns
Trang 21byte 8
3 byte location with address 1
2 byte location with address 4
1 byte location with address 6
3 byte location with address 7
Trang 22– High-level languages (such as Fortran, Cobol,
Pascal, C, C++, Java, etc.)
Each programming language has a defined
set of rules that govern the structure of its
program
Trang 241/24
A group of bytes (i.e a sequence of bits) can
represent many different things: a number *,
a character, a string, a picture, a sound track,
a video, or a program instruction
* a real number (one with a fractional part) is represented
by two sequences of bits, one for the mantissa and one for the exponent
Trang 25 e.g the bit sequence 01000001can be
Trang 29Algorithms
Consider the algorithm (an unambiguous
sequence of instructions to perform some
task)
Pseudocode
IF X equals Y THEN
Assign zero to Z ELSE
Assign Y / (X - Y) to Z ENDIF
{next statement}
Trang 311/31
System software
Supports basic operations of the computer
such as managing resources, allowing
transfer of information to and from the
computer
Examples
– Operating systems (e.g Unix, Windows)
– Communication software (to connect to other
computers and the Internet)
– Compilers (translate high-level programs into
executable code)
Trang 32– Other programs, for example programs to
support operations of organisations
Trang 33Next lecture
Operating systems
The Unix operating system
Compiling and running Java programs