| Chapter 3 |
Program Statements (p.121)
|
||||||||||||||
|
|
|||||||||||||||
| Chapter Objectives * Discuss basic program development steps. * Define the flow of control through a program. * Learn to use if statements. * Define expressions that let us make complex decisions. * Learn to use while and for statements. * Use conditionals and loops to draw graphics. |
|||||||||||||||
|
|||||||||||||||
| int max, number; System.out.print ("Enter an integer: "); max = Keyboard.readInt(); for (int count = 2; count <= 10; count++) { System.out.print ("Enter another integer: "); number = Keyboard.readInt(); if (number > max) max = number; } System.out.println ("The highest value is :" + max); |
|||||||||||||||