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 BLANKS QUESTION

2 mins • 1 pt

Media Image

Fill in the blanks to create a valid Scanner object.

(a)  

2.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Media Image

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

(a)  

3.

FILL IN THE BLANKS QUESTION

3 mins • 1 pt

Media Image

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

(a)  

4.

FILL IN THE BLANKS 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




(a)  

5.

FILL IN THE BLANKS 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




(a)  

6.

FILL IN THE BLANKS 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.

(a)  

7.

FILL IN THE BLANKS QUESTION

3 mins • 1 pt

Media Image

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

(a)  

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?