Search Header Logo

Final Exam Information

Authored by Folarin Omisakin

Science

University

Used 3+ times

Final Exam Information
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

36 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What must be included at the top of a Java program to use a Scanner for user input?

import java.util.Scanner;

package java.util.Scanner;

include java.util.Scanner;

using java.util.Scanner;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which package in Java contains the Scanner class?

java.lang

java.util

java.io

java.net

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the Java code 'Scanner input = new Scanner(System.in);'?

To create a file

To print a message to the console

To read input from the user

To close a program

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to read a double value from the user in Java?

nextLine()

nextDouble()

nextInt()

nextBoolean()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the output be if the user enters '5.5' after the statement 'System.out.println("Enter the radius: ");' is executed?

Enter the radius: 5.5

Error

5.5

Enter the radius:

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the "+=" operator do in programming?

Multiplies and assigns the value

Divides and assigns the value

Adds and assigns the value

Subtracts and assigns the value

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used for division assignment?

%=

*=

-=

/=

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?