|
Computer Science (CSCI)
Department |
|||
|
|||
Control Structures and Relational Operators
(Example code and figures from Computing Concepts with Java Essentials,
3rd edition, by Cay Horstmann.
Visit www.wiley.com/college/horstmann
for information on the current edition of this excellent text.)
|
|
|
|
|
$10,000 |
|
|
$10,500 |
|
|
$11,025 |
|
|
$11,576.25 |
|
|
$12,155.06 |
|
|
$12,762.82 |
while (condition) statement; |
while (balance < targetBalance)
{
|
while (year < 20) |
while (year > 0) |
year = 0; |
do |
double value; |

for (initialization; condition; update) |
for (int i = 1; i <= n; i++) |
initialization; |
sum = 0; |
for (i = 1; i <= 10; sum = sum + i++) |
for (int i = 1; i <= n; i++) |
for (int j = 1; j <= i; j++) |
boolean done = false;
while (!done)
{
String input = read input;
|
StringTokenizer tokenizer |
for (int i = 0; i < s.length(); i++) |
int vowelCount = 0; |
Random generator = new Random(); int n = generator.nextInt(a); // 0 <= n < a |
int d = 1 + generator.nextInt(6); |
|
Exercise - you know what to do - play with these... |