Search Header Logo

Java Programming Quiz

Authored by Nurul Izzati

English

12th Grade

Java Programming Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the program in Listing 2.1?

To calculate the area of a rectangle

To calculate the area of a circle

To calculate the volume of a sphere

To calculate the perimeter of a triangle

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to declare and initialize a variable in Java?

int x = 1;

x = 1;

double radius;

char ans = 'A';

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which data type is used to store a large amount of money in Java?

byte

float

short

long

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the remainder operator (%) in Java?

To calculate the square root of a number

To determine if a number is even or odd

To find the average of two numbers

To perform division with decimal numbers

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the program in the 'DisplayTime' class when the user enters 120 seconds?

120 seconds is 2 minutes and 0 seconds

120 seconds is 1 minute and 60 seconds

120 seconds is 1 minute and 0 seconds

120 seconds is 2 minutes and 60 seconds

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of 1.0 - 0.1 - 0.1 - 0.1 - 0.1 - 0.1?

0.49999999999999994

0.5

0.4999999999999999

0.5000000000000001

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of Math.pow(2.5, -2)?

0.25

0.125

0.16

0.0625

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?