Question: Put the lines of code in the correct order to print: 1,2,3,4,5. 1. Line 1 2. Line 2 3. Line 3 4. Line 4 5.
Put the lines of code in the correct order to print: 1,2,3,4,5.
1. Line 1
2. Line 2
3. Line 3
4. Line 4
5. Line 5
6. Line 6
Answer Choices:
A. System.out.print(x);
B. while (x 5) {
C. System.out.print("," + x);
D. }
E int x = 1;
F x++;
Put the lines of code in the correct order to print: 1,2,3,4,5.
1. Line 1
2. Line 2
3. Line 3
4. Line 4
5. Line 5
6. Line 6
Answer choices:
A. System.out.print(x + ",");
B.int x = 1;
C.while (x 5) {
D.System.out.print(x);
E.x++;
F.}
Suppose rand is a Random object. Match each of the following method calls to the range of possible values.
1. rand.nextBoolean( )
2. rand.nextInt(10)
3. 1 + rand.nextInt(10)
4. 2 * rand.nextDouble( )
5. -1 + 2 * rand.nextDouble( )
Answer Choices
A.a double between 0 and 2
B an int from 1 to 10
C an int from 0 to 9
D a double between -1 and 1
E true or false
Second Part
What is the flow of control for a do/while loop?
Answer Choices: A. If the test is true, go to Step 1, else go to the next step. B.Execute the body of the do/while loop. C. Execute the statement(s) after the do/while. D. Evaluate the do/while loop test.
1. Step 1
2. Step 2
3. Step 3
4. Step 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
