WorksheetsFor Loops and Random Numbers Check for Understanding
Total questions: 10
Worksheet time: 15mins
2
5
7
9
13
20
int count = 0;
while (count < 10) {
System.out.println("Welcome to Java");
count++;
}
This loop can only be used when the programmer knows the number of times a code is to be repeated
while
for
do while
repeat until
Which of the following control structure are needed to repeat a code?
sequence
loop
selection
if
FOR loops are
loops which run an unknown number of times
loops which run for a specific number of times
the same as if statements
not part of programming
Which kind of loop would be used?
I need a program that will keep letting me add a monthly payment for 12 months.
FOR Loop
WHILE Loop
How many times does Karel move with this loop?
9
0
10
1
Which command provides a random color?
Randomizer.color
Randomizer.nextColor()
RandColor;
nextColor.Randomizer()
Repeat something 10 times
repeat 10
for (var i=0; i<10; i++)
repeat { } until 10;
while (i = 10)
Which of the following describes numbers that do not follow a pattern?
A. variable numbers
B. flexible numbers
C. random numbers
D. static numbers
