What range of numbers does Math.random() output?
Blog
When you want to repeat a specific number of times, which lo…
When you want to repeat a specific number of times, which loop is best suited?
When you want the loop to repeat at least once, which loop i…
When you want the loop to repeat at least once, which loop is best suited?
What does the break keyword do in a loop?
What does the break keyword do in a loop?
Consider the following portion of code. int x = (int)(Math.r…
Consider the following portion of code. int x = (int)(Math.random()) * 100; System.out.println(x); What’s the smallest value that could be printed? _____ What’s the largest value that could be printed? _____
When you want to choose between running two blocks of code,…
When you want to choose between running two blocks of code, which structure would be most appropriate?
What is the output of the following portion of code? int x =…
What is the output of the following portion of code? int x = 7; if (x % 2 == 0) { x /= 2; } else if (x == 5 || x == 7) { x *= 2; } else { x = 99; } System.out.println(x);
When you want to choose between running three blocks of code…
When you want to choose between running three blocks of code, which structure would be most appropriate?
What is the output of the following portion of code? int cou…
What is the output of the following portion of code? int counter = 0; for (int i = 0; i < 63; i++) { counter++; } System.out.println(counter);
Fill in the blanks to print x and y. Do not include any addi…
Fill in the blanks to print x and y. Do not include any additional formatting. int x = 5; int y = 9; System.out.printf(“_____\t_____\n”, _____, _____);