Professional Documents
Culture Documents
(1) Points
True
False (*)
Correct
(1) Points
True (*)
m
er as
False
co
Correct
eH w
o.
3. The purpose of adding comments is to increase the ability to understand
the logic easily. rs e
ou urc
Mark for Review
(1) Points
o
aC s
True (*)
vi y re
False
Correct
ed d
4. A while loop is often used with Scanner input as you don't know many
ar stu
times you'll need to re-prompt the user if they type bad data.
Mark for Review
is
(1) Points
True (*)
Th
False
Correct
sh
(1) Points
do-while
This study source was downloaded by 100000837180363 from CourseHero.com on 11-19-2021 10:07:19 GMT -06:00
https://www.coursehero.com/file/69893204/JFo-Section-6-Quizdocx/
forEach
while(*)
for(*)
Correct
6. Which statement is true?
Mark for Review
(1) Points
The boolean expression that determines the number of loop iterations is
within the parentheses of a while loop. (*)
A counter (i) is declared and initialized inside the while loop.
A while loop boolean expression is made up of a counter, increment, and
test.
m
The counter which gets incremented determines the number of loop
er as
iterations is within the parentheses of a while loop.
co
eH w
Correct
o.
7. What is the output? rs e
ou urc
public static void main(String[] args) {
int num = 1;
o
num = num * 5;
}
}
ed d
(1) Points
1 5 25 125 175
1 5 25 125
is
5 25 125
Th
No output. (*)
Correct
sh
(1) Points
This study source was downloaded by 100000837180363 from CourseHero.com on 11-19-2021 10:07:19 GMT -06:00
https://www.coursehero.com/file/69893204/JFo-Section-6-Quizdocx/
True
False (*)
Correct
(1) Points
Statements in the loop are executed once until the condition becomes false.
Statements in the loop are executed repeatedly until the condition becomes
false.
The number of times a do-while loop is executed is dependent upon the
value of the counter variable. (*)
m
er as
Statements in the loop are executed once initially, and then the condition is
co
evaluated.
eH w
Correct
o.
rs e
10. Which statement will produce the output: 2, 4, 6, 8, 10?
ou urc
Mark for Review
o
(1) Points
for (int i = 0; i < 10; i += 2) {
aC s
}
for (int i = 1; i < 10; i += 2) {
System.out.print(i + " ");
ed d
}
ar stu
11. Looping continues as long as the boolean expression in the for loop is
false.
Mark for Review
(1) Points
This study source was downloaded by 100000837180363 from CourseHero.com on 11-19-2021 10:07:19 GMT -06:00
https://www.coursehero.com/file/69893204/JFo-Section-6-Quizdocx/
True
False (*)
Correct
12. Loops are used in programs for repeated execution of one or more
statements until a terminating condition is reached.
Mark for Review
(1) Points
True (*)
False
Correct
m
13. Given:
er as
co
for(int i = 0; i > 10; i++){ }
eH w
What type of variable is i?
o.
Mark for Review rs e
ou urc
(1) Points
Member
o
aC s
Global
vi y re
Static
Local (*)
Correct
ed d
ar stu
14. The initialization expression initializes the loop and it is executed only
once, as the loop begins.
Mark for Review
is
(1) Points
Th
True (*)
False
Correct
sh
(1) Points
This study source was downloaded by 100000837180363 from CourseHero.com on 11-19-2021 10:07:19 GMT -06:00
https://www.coursehero.com/file/69893204/JFo-Section-6-Quizdocx/
True (*)
False
Correct
m
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
ed d
ar stu
is
Th
sh
This study source was downloaded by 100000837180363 from CourseHero.com on 11-19-2021 10:07:19 GMT -06:00
https://www.coursehero.com/file/69893204/JFo-Section-6-Quizdocx/
Powered by TCPDF (www.tcpdf.org)