Instructions: This is an ungraded fill-in-the-blank exercise. Each question consists of a sentence with one or two words left out. A button represents the missing word(s). For each question, think of the word or phrase that should fill each blank, then click on the buttons to see if you are correct. No grade is calculated for this exercise.
This exercise reviews loops and the while statement.
class Counter
{
public static void main (String[] args)
{
int count ;
{
System.out.println( count );
}
}
}
8. The following program is supposed to write out the
integers 10, 11, 12, 13, 14, and 15.
Decide what should go in the blanks.
class Counter2
{
public static void main (String[] args)
{
int j ;
{
System.out.println( j );
}
}
}
9. The following program is supposed to write out the
integers 0, 2, 4, 6.
Decide what should go in the blanks.
class Counter3
{
public static void main (String[] args)
{
int j ;
{
System.out.println( j );
}
}
}
10. The following program is supposed to write out the
integers 2, 1, 0, -1 .
Decide what should go in the blanks.
class Counter3
{
public static void main (String[] args)
{
int count ;
{
System.out.println( count );
}
}
}