Java Random Output Quiz

Java Random Output Quiz

11th Grade

10 Qs

quiz-placeholder

Similar activities

Quiz 2 Java

Quiz 2 Java

11th Grade

15 Qs

For Loop

For Loop

9th - 12th Grade

10 Qs

AP CSA Unit 1 & 2 Review

AP CSA Unit 1 & 2 Review

9th - 12th Grade

10 Qs

Java

Java

11th Grade

10 Qs

Java Math

Java Math

1st - 12th Grade

10 Qs

Java Beginners

Java Beginners

11th Grade

15 Qs

Kuis Dadakan ;)

Kuis Dadakan ;)

10th Grade - University

15 Qs

Java Code

Java Code

10th - 12th Grade

12 Qs

Java Random Output Quiz

Java Random Output Quiz

Assessment

Quiz

Computers

11th Grade

Easy

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?