Deck 4: Loops and Files

Full screen (f)
exit full mode
Question
The do-while loop must be terminated with a semicolon.
Use Space or
up arrow
down arrow
to flip the card.
Question
A(n) __________ is a special value that cannot be mistaken as a member of a list of data items and signals that there are no more data items to be processed.

A) accumulator
B) sentinel
C) delimiter
D) terminator
Question
In a for loop, the control variable is always incremented.
Question
The do-while loop is ideal in situations where you always want the loop to iterate at least once.
Question
A loop that executes as long as a particular condition exists is called a(n) __________ loop.

A) infinite
B) count-controlled
C) conditional
D) relational
Question
When the continue statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.
Question
When you open a file with the PrintWriter class, the class can potentially throw an IOException.
Question
When you pass the name of a file to the PrintWriter constructor and the file already exists, it will be erased and a new empty file with the same name will be created.
Question
An item that separates other items is known as a

A) partition
B) delimiter
C) sentinel
D) terminator
Question
A loop that repeats a specific number of times is known as a(n) __________ loop.

A) count-controlled
B) infinite
C) conditional
D) pretest
Question
A __________ loop will always be executed at least once.

A) pretest
B) posttest
C) conditional
D) user-controlled
Question
When the break statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.
Question
The variable used to keep a running total in a loop is called a(n) __________.

A) accumulator
B) sentinel
C) summation
D) integer
Question
Java provides a set of simple unary operators designed just for incrementing and decrementing variables.
Question
In a for loop, the control variable cannot be initialized to a constant value and tested against a constant value.
Question
Before entering a loop to compute a running total, the program should first

A) set the accumulator variable to an initial value, often zero
B) set all variables to zero
C) read all the values into main memory
D) know exactly how many values there are to total
Question
The while loop is always the best choice in situations where the exact number of iterations is known.
Question
The while loop has two important parts: (1) a boolean expression that is tested for a true or false value, and (2) a statement or block of statements that is repeated as long as the expression is true.
Question
A file must always be opened before using it and closed when the program is finished using it.
Question
A __________ is a value that signals when the end of a list of values has been reached.

A) terminal
B) sentinel
C) token
D) delimiter
Question
When working with the PrintWriter class, which of the following import statements should you have near the top of your program?

A) import javax.swing.*;
B) import javac.io.*;
C) import java.io.*;
D) import java.file.*;
Question
How many times will the following do-while loop be executed?
int x = 11;
Do
{
X += 20;
} while (x > 100);

A) 0
B) 1
C) 5
D) 4
Question
The __________ loop is ideal in situations where you always want the loop to iterate at least once.

A) for
B) while
C) do-while
D) posttest
Question
What will be the value of x after the following code is executed?
int x, y = 4, z = 6;
X = (y++) * (++z);

A) 24
B) 28
C) 30
D) 35
Question
Which of the following is the method you can use to determine whether a file exists?

A) the File class's canOpen method
B) the Scanner class's exists method
C) the File class's exists method
D) the PrintWriter class's fileExists method
Question
If a loop does not contain, within itself, a valid way to terminate, it is called a(n) __________ loop

A) for
B) while
C) do-while
D) infinite
Question
In all but very rare cases, loops must contain, within themselves

A) nested loops
B) a way to terminate
C) arithmetic operators
D) nested decision strucures
Question
Which of the following statements opens a file named MyFile.txt and allows you to read data from it?

A) Scanner inputFile = new Scanner("MyFile.txt");
B) File file = new File("MyFile.txt");
Scanner inputFile = new Scanner(file);
C) File Scanner = new File("MyFile.txt");
D) PrintWriter inputFile = new PrintWriter("MyFile.txt");
Question
What will be the value of x after the following code is executed?
int x, y = 15;
X = y--;

A) 14
B) 16
C) 0
D) 15
Question
What will be the value of x after the following code is executed?
int x = 10;
While (x < 100)
{
X += 100;
}

A) 100
B) 90
C) 110
D) 10
Question
What will be the value of x after the following statements are executed?
int x = 10;
For (int y = 5; y < 20; y +=5)
X += y;

A) 25
B) 30
C) 50
D) 40
Question
Given the following statement, which statement will write the string "Calvin" to the file DiskFile.txt?
PrintWriter diskOut = new PrintWriter("DiskFile.txt");

A) System.out.println(diskOut, "Calvin");
B) PrintWriter.println("Calvin");
C) DiskFile.println("Calvin");
D) diskOut.println("Calvin");
Question
What will be the values of x and y as a result of the following code?
int x = 25, y = 8;
X += y++;

A) x = 34, y = 9
B) x = 25, y = 8
C) x = 33, y = 8
D) x = 33, y = 9
Question
How many times will the following do-while loop be executed?
int x = 11;
Do
{
X += 20;
} while (x <= 100);

A) 5
B) 4
C) 3
D) 1
Question
Assume that inputFile references a Scanner object that was used to open a file. Which of the following while loops is the correct way to read data from the file until the end of the file is reached?

A) while (inputFile.nextLine == " ")
{ ).. }
B) while (inputFile != null)
{ ).. }
C) while (!inputFile.EOF)
{ ).. }
D) while (inputFile.hasNext())
{ ).. }
Question
What will be printed after the following code is executed? for (int number = 5; number <= 15; number +=3)
System.out.print(number + ", ");

A) 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
B) 5, 8, 11, 14, 17,
C) 5, 8, 11, 14
D) This is an invalid for statement.
Question
The __________ loop is ideal in situations where the exact number of iterations is known.

A) for
B) while
C) do-while
D) posttest
Question
How many times will the following for loop be executed?
for (int count = 10; count <= 21; count++)
System.out.println("Java is great!");

A) 0
B) 12
C) 10
D) 11
Question
Which of the following statements opens a file named MyFile.txt and allows you to append data to its existing contents?

A) FileWriter fwriter = new FileWriter("MyFile.txt");
PrintWriter outFile = new PrintWriter(fwriter);
B) FileWriter fwriter = new FileWriter("MyFile.txt", true);
PrintWriter outFile = new PrintWriter(fwriter);
C) PrintWriter outfile = new PrintWriter("MyFile.txt", true);
D) PrintWriter outfile = new PrintWriter(true, "MyFile.txt");
Question
Assuming that inputFile references a Scanner object that was used to open a file, which of the following statements will read an int from the file?

A) int number = inputFile.next();
B) int number = inputFile.integer();
C) int number = inputFile.readInt();
D) int number = inputFile.nextInt();
Question
What will be the values of x aand y after the following code is executed? int x = 12, y = 5;
X += y--;

A) x = 12, y = 5
B) x = 16, y = 4
C) x = 17, y = 5
D) x = 17, y = 4
Question
What will be the values of x and y after the following code is executed? int x, y = 15, z = 3;
X = (y--) / (++z);

A) 3
B) 4
C) 5
D) 6
Question
Which is a control structure that causes a statement or group of statements to repeat?

A) block
B) loop
C) prefix mode
D) body
Question
Select all that apply. Which method of the Random class will return a random number within the range of 0.0 and 1.0?

A) nextDouble()
B) nextLong()
C) nextFloat()
D) nextInt(int n)
Question
Which of the following statements will create an object from the Random class?

A) randomNumbers() = new Random();
B) Random myNumber = new Random();
C) myNumber = new Random();
D) Random = new randomNumbers();
Question
Which of the following are pre-test loops?

A) while, for, do-while
B) while, do-while
C) while, for
D) for, do-while
Question
Select all that apply. Which of the following steps is normally performed by a for loop?

A) update the control variable during each iteration
B) test the control variable by comparing it to a maximum or minimum value
C) terminate when the control variable reaches its maximum or minimum value
D) initialize the control variable to a starting value
Question
A random number, created as an object of the Random class, is always a(n) __________.

A) object
B) integer
C) float
D) class
Question
What will be the value of x after the following code is executed?
int x = 10, y = 20;
While (y < 100)
{
X += y;
}

A) 90
B) 110
C) 210
D) this is an infinite loop
Question
In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner(System.in);
System.out.print("Enter a number: ");
Int number = keyboard.nextInt();
While (number < 100 && number > 500)
{
System.out.print("Enter another number: ");
Number = keyboard.nextInt();
}

A) Numbers less than 100 or greater than 500
B) Numbers in the range 100 - 499
C) Numbers in the range 100 - 500
D) Impossible - the boolean condition can never be true
Question
The variable that controls the number of times a loop iterates is known as a(n) __________.

A) counter variable
B) loop control variable
C) running total
D) decrement variable
Question
In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner(System.in);
System.out.print("Enter a number: ");
Int number = keyboard.nextInt();
While (number < 100 || number > 500)
{
System.out.print("Enter another number: ");
Number = keyboard.nextInt();
}

A) Numbers less than 100
B) Numbers greater than 500
C) Numbers in the range 100 - 499
D) Numbers in the range 100 - 500
Question
What will be the value of x after the following code is executed?
int x = 10, y = 20;
While (y < 100)
{
X += y;
Y += 20;
}

A) 130
B) 210
C) 110
D) 90
Question
Each repetition of a loop is known as a(n) __________.

A) iteration
B) cycle
C) execution
D) lap
Question
The __________ loop allows the user to decide on the number of iterations.

A) counter controlled loop
B) dynamically executed loop
C) user controlled loop
D) infinite loop
Question
Which of the following expressions will generate a random number in the range of 1 through 10?

A) myNumber = randomNumbers.nextInt(10);
B) myNumber = randomNumbers.nextInt(1) + 10;
C) myNumber = randomNumbers.nextInt(11) - 1;
D) myNumber = randomNumbers.nextInt(10) + 1;
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/56
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 4: Loops and Files
1
The do-while loop must be terminated with a semicolon.
True
2
A(n) __________ is a special value that cannot be mistaken as a member of a list of data items and signals that there are no more data items to be processed.

A) accumulator
B) sentinel
C) delimiter
D) terminator
B
3
In a for loop, the control variable is always incremented.
False
4
The do-while loop is ideal in situations where you always want the loop to iterate at least once.
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
5
A loop that executes as long as a particular condition exists is called a(n) __________ loop.

A) infinite
B) count-controlled
C) conditional
D) relational
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
6
When the continue statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
7
When you open a file with the PrintWriter class, the class can potentially throw an IOException.
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
8
When you pass the name of a file to the PrintWriter constructor and the file already exists, it will be erased and a new empty file with the same name will be created.
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
9
An item that separates other items is known as a

A) partition
B) delimiter
C) sentinel
D) terminator
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
10
A loop that repeats a specific number of times is known as a(n) __________ loop.

A) count-controlled
B) infinite
C) conditional
D) pretest
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
11
A __________ loop will always be executed at least once.

A) pretest
B) posttest
C) conditional
D) user-controlled
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
12
When the break statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
13
The variable used to keep a running total in a loop is called a(n) __________.

A) accumulator
B) sentinel
C) summation
D) integer
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
14
Java provides a set of simple unary operators designed just for incrementing and decrementing variables.
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
15
In a for loop, the control variable cannot be initialized to a constant value and tested against a constant value.
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
16
Before entering a loop to compute a running total, the program should first

A) set the accumulator variable to an initial value, often zero
B) set all variables to zero
C) read all the values into main memory
D) know exactly how many values there are to total
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
17
The while loop is always the best choice in situations where the exact number of iterations is known.
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
18
The while loop has two important parts: (1) a boolean expression that is tested for a true or false value, and (2) a statement or block of statements that is repeated as long as the expression is true.
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
19
A file must always be opened before using it and closed when the program is finished using it.
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
20
A __________ is a value that signals when the end of a list of values has been reached.

A) terminal
B) sentinel
C) token
D) delimiter
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
21
When working with the PrintWriter class, which of the following import statements should you have near the top of your program?

A) import javax.swing.*;
B) import javac.io.*;
C) import java.io.*;
D) import java.file.*;
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
22
How many times will the following do-while loop be executed?
int x = 11;
Do
{
X += 20;
} while (x > 100);

A) 0
B) 1
C) 5
D) 4
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
23
The __________ loop is ideal in situations where you always want the loop to iterate at least once.

A) for
B) while
C) do-while
D) posttest
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
24
What will be the value of x after the following code is executed?
int x, y = 4, z = 6;
X = (y++) * (++z);

A) 24
B) 28
C) 30
D) 35
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
25
Which of the following is the method you can use to determine whether a file exists?

A) the File class's canOpen method
B) the Scanner class's exists method
C) the File class's exists method
D) the PrintWriter class's fileExists method
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
26
If a loop does not contain, within itself, a valid way to terminate, it is called a(n) __________ loop

A) for
B) while
C) do-while
D) infinite
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
27
In all but very rare cases, loops must contain, within themselves

A) nested loops
B) a way to terminate
C) arithmetic operators
D) nested decision strucures
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
28
Which of the following statements opens a file named MyFile.txt and allows you to read data from it?

A) Scanner inputFile = new Scanner("MyFile.txt");
B) File file = new File("MyFile.txt");
Scanner inputFile = new Scanner(file);
C) File Scanner = new File("MyFile.txt");
D) PrintWriter inputFile = new PrintWriter("MyFile.txt");
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
29
What will be the value of x after the following code is executed?
int x, y = 15;
X = y--;

A) 14
B) 16
C) 0
D) 15
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
30
What will be the value of x after the following code is executed?
int x = 10;
While (x < 100)
{
X += 100;
}

A) 100
B) 90
C) 110
D) 10
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
31
What will be the value of x after the following statements are executed?
int x = 10;
For (int y = 5; y < 20; y +=5)
X += y;

A) 25
B) 30
C) 50
D) 40
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
32
Given the following statement, which statement will write the string "Calvin" to the file DiskFile.txt?
PrintWriter diskOut = new PrintWriter("DiskFile.txt");

A) System.out.println(diskOut, "Calvin");
B) PrintWriter.println("Calvin");
C) DiskFile.println("Calvin");
D) diskOut.println("Calvin");
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
33
What will be the values of x and y as a result of the following code?
int x = 25, y = 8;
X += y++;

A) x = 34, y = 9
B) x = 25, y = 8
C) x = 33, y = 8
D) x = 33, y = 9
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
34
How many times will the following do-while loop be executed?
int x = 11;
Do
{
X += 20;
} while (x <= 100);

A) 5
B) 4
C) 3
D) 1
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
35
Assume that inputFile references a Scanner object that was used to open a file. Which of the following while loops is the correct way to read data from the file until the end of the file is reached?

A) while (inputFile.nextLine == " ")
{ ).. }
B) while (inputFile != null)
{ ).. }
C) while (!inputFile.EOF)
{ ).. }
D) while (inputFile.hasNext())
{ ).. }
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
36
What will be printed after the following code is executed? for (int number = 5; number <= 15; number +=3)
System.out.print(number + ", ");

A) 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
B) 5, 8, 11, 14, 17,
C) 5, 8, 11, 14
D) This is an invalid for statement.
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
37
The __________ loop is ideal in situations where the exact number of iterations is known.

A) for
B) while
C) do-while
D) posttest
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
38
How many times will the following for loop be executed?
for (int count = 10; count <= 21; count++)
System.out.println("Java is great!");

A) 0
B) 12
C) 10
D) 11
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
39
Which of the following statements opens a file named MyFile.txt and allows you to append data to its existing contents?

A) FileWriter fwriter = new FileWriter("MyFile.txt");
PrintWriter outFile = new PrintWriter(fwriter);
B) FileWriter fwriter = new FileWriter("MyFile.txt", true);
PrintWriter outFile = new PrintWriter(fwriter);
C) PrintWriter outfile = new PrintWriter("MyFile.txt", true);
D) PrintWriter outfile = new PrintWriter(true, "MyFile.txt");
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
40
Assuming that inputFile references a Scanner object that was used to open a file, which of the following statements will read an int from the file?

A) int number = inputFile.next();
B) int number = inputFile.integer();
C) int number = inputFile.readInt();
D) int number = inputFile.nextInt();
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
41
What will be the values of x aand y after the following code is executed? int x = 12, y = 5;
X += y--;

A) x = 12, y = 5
B) x = 16, y = 4
C) x = 17, y = 5
D) x = 17, y = 4
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
42
What will be the values of x and y after the following code is executed? int x, y = 15, z = 3;
X = (y--) / (++z);

A) 3
B) 4
C) 5
D) 6
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
43
Which is a control structure that causes a statement or group of statements to repeat?

A) block
B) loop
C) prefix mode
D) body
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
44
Select all that apply. Which method of the Random class will return a random number within the range of 0.0 and 1.0?

A) nextDouble()
B) nextLong()
C) nextFloat()
D) nextInt(int n)
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
45
Which of the following statements will create an object from the Random class?

A) randomNumbers() = new Random();
B) Random myNumber = new Random();
C) myNumber = new Random();
D) Random = new randomNumbers();
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
46
Which of the following are pre-test loops?

A) while, for, do-while
B) while, do-while
C) while, for
D) for, do-while
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
47
Select all that apply. Which of the following steps is normally performed by a for loop?

A) update the control variable during each iteration
B) test the control variable by comparing it to a maximum or minimum value
C) terminate when the control variable reaches its maximum or minimum value
D) initialize the control variable to a starting value
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
48
A random number, created as an object of the Random class, is always a(n) __________.

A) object
B) integer
C) float
D) class
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
49
What will be the value of x after the following code is executed?
int x = 10, y = 20;
While (y < 100)
{
X += y;
}

A) 90
B) 110
C) 210
D) this is an infinite loop
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
50
In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner(System.in);
System.out.print("Enter a number: ");
Int number = keyboard.nextInt();
While (number < 100 && number > 500)
{
System.out.print("Enter another number: ");
Number = keyboard.nextInt();
}

A) Numbers less than 100 or greater than 500
B) Numbers in the range 100 - 499
C) Numbers in the range 100 - 500
D) Impossible - the boolean condition can never be true
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
51
The variable that controls the number of times a loop iterates is known as a(n) __________.

A) counter variable
B) loop control variable
C) running total
D) decrement variable
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
52
In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner(System.in);
System.out.print("Enter a number: ");
Int number = keyboard.nextInt();
While (number < 100 || number > 500)
{
System.out.print("Enter another number: ");
Number = keyboard.nextInt();
}

A) Numbers less than 100
B) Numbers greater than 500
C) Numbers in the range 100 - 499
D) Numbers in the range 100 - 500
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
53
What will be the value of x after the following code is executed?
int x = 10, y = 20;
While (y < 100)
{
X += y;
Y += 20;
}

A) 130
B) 210
C) 110
D) 90
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
54
Each repetition of a loop is known as a(n) __________.

A) iteration
B) cycle
C) execution
D) lap
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
55
The __________ loop allows the user to decide on the number of iterations.

A) counter controlled loop
B) dynamically executed loop
C) user controlled loop
D) infinite loop
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
56
Which of the following expressions will generate a random number in the range of 1 through 10?

A) myNumber = randomNumbers.nextInt(10);
B) myNumber = randomNumbers.nextInt(1) + 10;
C) myNumber = randomNumbers.nextInt(11) - 1;
D) myNumber = randomNumbers.nextInt(10) + 1;
Unlock Deck
Unlock for access to all 56 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 56 flashcards in this deck.