B4 - The if Statement

B4 - The if Statement

University

5 Qs

quiz-placeholder

Similar activities

Test Development

Test Development

University

10 Qs

QUIZ 1

QUIZ 1

University

10 Qs

SEEU1002_2021-2_Chapter 5 (Transformer)

SEEU1002_2021-2_Chapter 5 (Transformer)

University

10 Qs

CALCITONIN (MUSCULOSKELETAL)

CALCITONIN (MUSCULOSKELETAL)

University

10 Qs

iNTRODUCTION TO OS

iNTRODUCTION TO OS

University

10 Qs

UK Knowledge Test

UK Knowledge Test

University

10 Qs

Alien Hand Syndrome

Alien Hand Syndrome

University

10 Qs

Risk Management: Credit risk and Market risk

Risk Management: Credit risk and Market risk

University

10 Qs

B4 - The if Statement

B4 - The if Statement

Assessment

Quiz

Other

University

Practice Problem

Hard

Created by

Ahmetcan türk

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many choices are possible when using a single if-else statement?

1

2

3

4

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code fragment write to the monitor?


int sum = 14;

if ( sum < 20 )

System.out.print("Under ");

else

{

System.out.print("Over ");

System.out.println("the limit.");

}

Under

Over

Under the limit

Over the limit

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code fragment write to the monitor?


int sum = 7;

if ( sum > 20 )

{

System.out.print("You win ");

}

else

{

System.out.print("You lose ");

}


System.out.println("the prize.");

You win

You lose

You win the prize.

You lose the prize.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code fragment write to the monitor?


int sum = 21;

if ( sum != 20 )

System.out.print("You win ");

else

System.out.print("You lose ");


System.out.println("the prize.");

You win

You lose

You win the prize

You lose the prize

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Evaluate (to true or false) each of the following expressions:

14 <= 14 14 < 14 -9 > -25 -25 > -9

true true true true

true false false false

true false true true

true false true false