Summary

 

Lets wrap up what we've learn so far. We have learn how to print, ask users for inputs, using if-else/else-if, loops
and dealing math expressions. Now lets refresh our memory for a little.

The if statement has this form

if ( boolean - expression )
    statement...

 

The if-else statement has this form

if ( boolean-expression)
    statement

else
    statement

The basic format of a for loop

for ( initialization-expression; testing-expression; counting-expression;)
{

        statements;

}

The basic format of a do-while loop

do
{
    statement;
}while(expression);

The basic format of a while loop

while (expression)
    statement;

 

Now lets look at a comprehensive example.

ClickHere to download Atm.java

 

  <Java 24><Home>