Program NYUSUKI

hayo gimana bikin program Nyusuki (kaya’ di Vending Machine) pake Java….
Contoh: Mesin harus ngembalikan uang 85 sen padahal ada koin 25-an, 10-an, 5-an, dan 1-an
gimana mesin bisa tahu harus ngembalikan 3 koin 25-an + 1 koin 10-an + 1 koin 5-an
Benernya ini khan logika biasa banget ya bagi kita manusia: biasanya ‘Algoritma’ cara mikir kita [...]

Arithmetic OPERATOR

Highest Precedence

First priority : the unary operators +, – , ++, –, !

e.g. total = – a;

Second : binary arithmetic operators *, / , %

e.g. total = a/b;

Third : binary arithmetic operators +, –

e.g. total = a + b;

Three Main Components in my Simple Java Program

Let’s take a look at my simplest java Source Code “Hello Tony!”
At least I have to write 3 component:
1. Firstly, I must to define my CLASS Name
with sintax
————-
class name {

}

————-
in here I read this concept like: “this is a class named … and the content of the class inside { …} “

COMMENTS in Java Source-Code

Comments are ignored by the compiler but are useful to other programmers. The Java programming language supports three kinds of comments:
// one line comment
/* comment */
/** comment */

First Program JAVA “Hello Tony!”

as common…for the first time, I tried to write my simplest source-code and just using NOTE-PAD as my Editor.
Let’s write Java source code displaying sentence “Hello Tony!”

How to Set Up the PATH variable?

We can run the Java 2 SDK without setting the PATH variable, or you can optionally set it as a convenience.
Should I set the PATH variable?
Set the PATH variable if you want to be able to conveniently run the Java 2 SDK executables (javac.exe, java.exe, javadoc.exe, etc.) from any directory without having to type the [...]

install the ‘Java Platform’ on your PC!

Again..before you can run a Java program (Java byte-code or even Java source-code), you must set up the Java Platform (JVM+API) on your PC.
When I am writing this, the latest Java Platform(JVM + API) -Standard Edition for Windows is JDK 6 which can be download at here

How to Install the Java Platform [...]

Java Platform

The Java platform consists of:
1. the Java application programming interfaces (APIs) and
2. the Java Virtual Machine (JVM).
A Java program which is written in Java language just can be run in computer which has installed the Java Platform.

Start to Write JAVA Source Code….Let’s use “TextPad”

We also can learn about our first Java source code at http://java.sun.com/developer/onlineTraining/Programming/BasicJava1/compile.html
1. Downloaded A free, trial version of TextPad from www.textpad.com and install it.

Java is ‘High-Level Programming Language’ …but…

As we know,
* the ‘High-Level Programming Language‘ : a programming languages which are designed EASY for people to write and to understand.
included: Java, VB, C++, BASIC, FORTRAN, PASCAL, …
Unfortunately, the computer machine just can understand the MACHINE/ASSEMBLY languages….so