Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

20 quick easy java questions? 1. A structure that allows repeated execution of a block of statements is a _____. a. ring b. cycle c.

20 quick easy java questions?

1. A structure that allows repeated execution of a block of statements is a _____.

a. ring
b. cycle
c. band

d. loop

2. A loop that never ends is a(n) _____ loop.

a. illegal
b. iterative
c. infinite

d. structured

3. To construct a loop that works correctly, you should initialize a loop control _____.

a. condition
b. structure
c. variable

d. constant

4. One execution of any loop is called a(n) _____.

a. iteration
b. cycle
c. pass

d. round

5. To prevent a while loop from executing infinitely, which of the following actions must not occur?

a. A loop control variable is initialized to a starting value.
b. The loop control variable is altered within the body of the loop.
c. The loop control variable is tested in the while statement.

d. The loop control variable is reset to its starting value during each iteration of the loop.

6. A value that stops a loop is a _____.

a. block
b. sentinel
c. guard

d. token

7. If total = 100 and amt = 200, then after the statement total += amt, _____.

a. amt is equal to 300
b. total is equal to 200
c. total is equal to 300

d. amt is equal to 100

8. The modulus operator ( % ) is a _____ operator.

a. unary
b. postfix
c. tertiary

d. binary

9. The prefix ++ is a _____ operator.

a. tertiary
b. binary
c. unary

d. postfix

10. If g = 5, then after h = ++g, the value of h is _____.

a. 4
b. 7
c. 6

d. 5

11. If m = 9, then after n = m++, the value of n is _____.

a. 8
b. 9
c. 10

d. 11

12. If j = 5 and k = 6, then the value of j++ == k is _____.

a. true
b. 6
c. false

d. 5

13. You must always include _____ in a for loop's parentheses.

a. two commas
b. three commas
c. two semicolons

d. three semicolons

14. When loops are nested, each pair contains a(n) _____ loop and a(n) _____ loop.

a. lower, upper
b. child, parent
c. inner, outer

d. inside, outside

15. Loop _____ is the technique of combining two loops into one.

a. union
b. fusion
c. synthesis

d. integration

16. When incrementing the loop control variable in a for statement, using the _____ operator produces a faster loop.

a. prefix increment
b. postfix increment
c. assign

d. modulus

17. The loop that performs its conditional check at the bottom of the loop is a _____ loop.

a. while
b. for
c. do...while

d. for...while

18. A(n) _____ is the first input statement prior to a loop that will execute subsequent input statements for the same variable.

a. priming read
b. preparation
c. start statement

d. initializing read

19. A(n) _____ loop is an indefinite loop in which the number of executions is determined by user actions.

a. undetermined
b. dynamic
c. random

d. event-controlled

20. Which of the following will not help improve loop performance?

a. Making a comparison to -1.
b. Making sure the loop does not include unnecessary operations or statements.
c. Employing loop fusion to combine loops.
d. Considering the order of evaluation for short-circuit operators.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Evaluate employees readiness for training. page 275

Answered: 1 week ago