conditional constructs in Java

conditional constructs in Java

10th Grade

10 Qs

quiz-placeholder

Similar activities

TIN HỌC 10 - BÀI 21

TIN HỌC 10 - BÀI 21

10th Grade

10 Qs

HARDWARE AND SOFTWARE

HARDWARE AND SOFTWARE

2nd - 10th Grade

10 Qs

Q1 M 2 - TOPIC 2 / Check your understanding

Q1 M 2 - TOPIC 2 / Check your understanding

10th Grade

10 Qs

Y10M2A2 - Selection

Y10M2A2 - Selection

6th - 10th Grade

15 Qs

Chapter 8: Safety and security

Chapter 8: Safety and security

10th - 11th Grade

14 Qs

Quiz Excel 3

Quiz Excel 3

10th Grade

10 Qs

Cell Phone Vocabulary

Cell Phone Vocabulary

9th - 12th Grade

12 Qs

Función CONTAR

Función CONTAR

KG - Professional Development

10 Qs

conditional constructs in Java

conditional constructs in Java

Assessment

Quiz

Computers

10th Grade

Medium

Created by

Anita Thakur

Used 199+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

public void main()

{

double temp = 56.0;

if (temp <=54.0 && temp>40)

System.out.println(“It is too hot”);

else if ( temp<40 || temp>30)

System.out.println(“It is hot but not too much”);

else

System.out.println(“It is pleasant”);

}


What will be the output?

It is too hot

It is pleasant

It is hot but not too much

runtime error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

PREDICT THE OUTPUT:

int x = 20;

int y = 18;

if(x>y)

System.out.println("x is greater than y");

else

{

System.out.println("Error");

System.out.println("Incorrect code");

}

Error

Incorrect code

x is greater than y

Error

Incorrect code

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

PREDICT THE OUTPUT:

int x = 60;

int y = 90;

if (y%x == 0 && y-x==30)

{

System.out.println("Hello World");

}

else

{

System.out.println("Error")

}

Hello World

Hello world

Error

Hello World

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Re-write above statement using ternary operator-

if(X<=Y) then X=Y else Y=X;

if(X<=Y) ? X=Y : Y=X;

(X<=Y) ? X=Y : Y=X;

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int marks = 50;

if( marks > 70 )

System.out.println("Distinction");

else if( marks > 35 )

System.out.println("Pass");

else

System.out.println("Fail");

Pass

Distinction

Fail

Pass

Fail

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int marks = 80;

if( marks > 70 )

System.out.println("Distinction");

System.out.println("Congratulations");

else if( marks > 35 )

System.out.println("Pass");

Distinction

Congratulations

Pass

Distinction

Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

"if" is a conditional construct?

True

False

Create a free account and access millions of resources

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?