Escolar Documentos
Profissional Documentos
Cultura Documentos
Outline
Algorithm and the characteristic Programming language Six basic operation Expression of algorithm (Pseudocode and Flowchart) Introduction to Java
Java language specification and API Java Edition, JRE and JDK
Bina Nusantara
Algorithm
What is an algorithm?
A set of detailed, unambiguous and ordered instructions developed to describe the progress necessary to produce the desired output from a given input
Example:
If you want to instruct someone to add up a list of prices on a pocket calculator, the algorithm might be like this following sample:
Bina Nusantara
Characteristics of an Algorithm
Input Output Definiteness Finiteness Effectiveness
Bina Nusantara
Programming Language
What is programming?
Creation of program that is executable by a computer and performs the required tasks
The high-level languages are English-like and easy to learn and program The following well-known high-level languages:
Bina Nusantara
COBOL (Common Business Oriented Language) FORTRAN (FORmula TRANslation) Pascal C C++ (an object-oriented language, based on C) Java This is what we learn in this subject
6
Expression of Algorithm
An Algorithm can be expressed using some popular methods as below: Pseudocode Flowchart
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
10
Flowchart Symbols
The common symbols used to create a flowchart:
Bina Nusantara
11
Start
Finish
Dialing
Yes No
Talking
Yes
Waiting
Bina Nusantara
Connected 12
Input Number
Number % 2
1 0
END
Bina Nusantara
13
Introduction to Java
Bina Nusantara
14
Java
Java was developed by a team led by James Gosling at Sun Microsystems Originally called Oak (in 1991)
Design for use in embedded chips in consumer appliance
Bina Nusantara
15
Bina Nusantara
16
Bina Nusantara
17
JDK
Java Development Toolkit (JDK) consist of set of separate program, each invoked from a command line, for developing and testing Java programs. Java development tool is a software that provides an Integrated Development Environment (IDE) for rapidly developing Java programs. Example:
JBuilder by Borland (www.borland.com) NetBeans Open Source by Sun (www.netbeans.org) Eclipse Open Source by IBM (www.eclipse.org) Code Warrior by Metrowerks (www.metrowerks.com) TextPad Editor (www.textpad.com) JCreator LE (www.jcreator.com) JEdit (www.jedit.org)
Bina Nusantara
18
JVM
Bina Nusantara
19
Bytecode
Result
20
public class Welcome { public static void main(String [] args) { System.out.println(Welcome to Java!); } Class heading, String }
Main method signature
Filename: Welcome.java
Comments
Bina Nusantara
21
References
Daniel Liang, Y., 2011, Introduction to java programming, vol.08, Pearson Education, New Jersey. Chapter 1. Lesley Anne Robertson, 2006, Simple program design : a step by step approach, Vol.05, Course Technology.
Bina Nusantara
22