Search Header Logo

2. Control Flow Q (Java Introduction) 1

Authored by Anton Prafanto

Professional Development

University

Used 5+ times

2. Control Flow Q (Java Introduction) 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

26 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

2 mins • 1 pt

Media Image

Fill in the blanks to create a valid Scanner object.

2.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Media Image

Fill in the blank to test both conditions in the following if statement.

3.

FILL IN THE BLANK QUESTION

3 mins • 1 pt

Media Image

Fill in the blanks to create a valid program that takes a String input.

4.

FILL IN THE BLANK QUESTION

3 mins • 1 pt

Rearrange to create a valid program that takes an integer input and outputs its double.

int x = sc.nextInt(); //7

System.out.println(x*2); //6

Scanner sc = new Scanner(System.in); //2


5.

FILL IN THE BLANK QUESTION

5 mins • 1 pt

Rearrange the code to output the numbers 1 to 5 using a while loop.

num = num + 1; //1

System.out.println(num); //2

} //3

while(num <= 5){ //4

int num = 1; //5


6.

FILL IN THE BLANK QUESTION

3 mins • 1 pt

Media Image

Fill in the blanks to create a valid program that takes a String and an integer as input, then outputs a welcome message.

7.

FILL IN THE BLANK QUESTION

3 mins • 1 pt

Media Image

Fill in the blanks to output "Open" if the time value is less than 20.

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?