2008-03-11 22:00:42 UTC
True/False
-The operators != and == have the same order of precedence
-A for loop is a post-test loop.
-All switch cases include a break statement.
-An else statement must be paired with an if statement
-A compound statement or block of statements is treated as a single statement.
Multiple Choice...
for(i = 1; i < 20; i++)
System.out.println(“Hello World”);
System.out.println(“!”);
-According to the code above, how many times will Hello World be printed?
a.1 c. 19
b.18 d. 20
-According to the code above, how many times will the ! be printed?
a.1 c. 19
b.18 d. 20
int x = 0;
for(i = 0; i <4; i++);
x++;
if(x = = 3)
System.out.println(“*”);
What is the output of the code above?
a.* c. ***
b.** d. There is no output
int x = 5;
int y = 30;
do
x = x * 2;
while(x < y);
-How many times does the statement above execute?
-If y = 0, how many times would the loop above execute?