Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Course Overview
Semester October 2006
Course Coordinator:
Dr. Wendy Bong Chin-Wei
Course organisation
Tutorial 1
Semester October 2006
Course Coordinator:
Dr. Wendy Bong Chin-Wei
Why Java as ‘first’ course?
Accuracy
Speed
Availability
and convergence
Automation
Algorithms
executed in order,
passing and the control Get milk
passes unconditionally
from one statement to Get tea bag
the next
Boil water
......
A selection
A choice of Wake up
statements depending
on the result of a test
True False
or condition Weekday?
Sleep in Go to work
An iteration
True
Stop car
Number systems
Selectivity None,as each machine A computer can execute programs written in any
supports its own high-level programming language, provided
machine language. that a translation software is available.
How programs are executed
Interpretation
– interprets (analyses) each statement in the program and then
carries out the operations one after another
Compilation
– process of entirely translating a program written in a high-level
programming language into the corresponding machine
language before execution
– The software that compiles a program is called compiler
software (or simply a compiler).
– The result of compilation is known as object code, which is
composed of 0’s and 1’s.
– The machine only executes the object code.
Interpretation vs. Compilation
Interpretation Compilation
Execution Slower, as every statement is analysed Faster, as object code is generated once
speed each time before execution. and for all. No translation during
execution.
Execution Needs source code for real-time Source code is not necessary — just
model translation. object code.
Portability Needs an interpreter on every platform. Needs compilation once for each
platform.
Reliability Usually less reliable, as checking is done More reliable, because compilation
during interpretation. Program usually includes comprehensive
segments that have not been executed checking for the whole program.
will also be unchecked.
Intellectual Weak protection, since users can read Strong protection, since users find it
property and modify the source code. difficult to derive the program logic
or modify it.
Software development life cycle (SDLC)
Maintenance
Highly sophisticated software is generally too complex Phase
to build with a single pass of the above six phases
SDLC
Requirements phase
– thoroughly understand the purpose of the software, or the
‘problem’ to be solved by the software
– collect the requirements (needs) from the users
– a document known as a problem statement that summarises
the requirements of the clients, and the limitations of the
software
Analysis phase
– derive the roles, functionalities, operational scenarios, and the
business entities involved
Both are programming-language independent phases
SDLC cont’
Testing phase
– make sure that the programs actually perform as
expected
– verify the programs by feeding test data and
checking whether the outputs are exactly the
same as the expected results
Maintenance phase
– maintain the software system so that users can
keep continue to use and to rely on it.
Programming paradigm
programming style
provides (and determines) the view that the
programmer has of the execution of the
program.
some languages are designed to support one
particular paradigm while other programming
languages support multiple paradigms
Programming paradigm 1
- Imperative programming language
method n
Classes and Objects