
Java Random Output Quiz

Quiz
•
Computers
•
11th Grade
•
Easy
Jeanette Patterson
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What value(s) will be output by the following Java code statement? System.out.println( Math.random() * 3 );
A random double value between 0.0 and 3.0
A random integer value between 0 and 3
A constant value of 1.5
A random double value between 1.0 and 4.0
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What value(s) will be output by the following Java code statement? System.out.println( (int)(Math.random()*5) + 3 );
An integer value between 3 and 7
An integer value between 0 and 5
An integer value between 1 and 6
An integer value between 2 and 8
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What value(s) will be output by the following Java code statement? System.out.println( (int)Math.random()*4 + 5 );
5
6
7
8
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What value(s) will be output by the following Java code statement? System.out.println( Math.abs( -5.2 ) );
5.2
-5.2
0
5
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What value(s) will be output by the following Java code statement? System.out.println( (int)(Math.random()*5) + 3 );
3, 4, 5, 6, 7
0, 1, 2, 3, 4
5, 6, 7, 8, 9
1, 2, 3, 4, 5
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What value(s) will be output by the following Java code statement? System.out.println( (int)(Math.random()*50) );
A random integer between 0 and 49
A random integer between 1 and 50
A random integer between 0 and 50
A random integer between 1 and 49
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What value(s) will be output by the following Java code statement? System.out.println( Math.abs( 6 ) );
6
-6
0
Error
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
W8-11

Quiz
•
10th - 11th Grade
11 questions
Project STEM AP CS A Unit 1 Quiz Review

Quiz
•
9th - 12th Grade
10 questions
APCSA - Unit 3

Quiz
•
9th - 12th Grade
13 questions
Intro to IF statements

Quiz
•
KG - University
15 questions
Java Arrays Prt 1Quiz

Quiz
•
9th - 12th Grade
12 questions
Unit 5 Lists, Loops, & Traversals

Quiz
•
10th - 12th Grade
15 questions
Java Methods Quiz

Quiz
•
11th Grade
11 questions
Java Boolean Statements

Quiz
•
11th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade