Java Conditional Constructs

Java Conditional Constructs

9th - 10th Grade

20 Qs

quiz-placeholder

Similar activities

Basics in Java

Basics in Java

9th - 12th Grade

15 Qs

Quarter 3 Final Exam: Functions and Parameters

Quarter 3 Final Exam: Functions and Parameters

9th - 12th Grade

20 Qs

Computer Application Practice Quiz Class 10

Computer Application Practice Quiz Class 10

10th Grade

20 Qs

Unit 5 Review

Unit 5 Review

9th - 12th Grade

18 Qs

APCSA Unit 3

APCSA Unit 3

9th Grade

20 Qs

Strings + Revision

Strings + Revision

9th - 10th Grade

18 Qs

Java switch/for/while

Java switch/for/while

9th - 12th Grade

15 Qs

Java Conditional Statements

Java Conditional Statements

9th Grade

16 Qs

Java Conditional Constructs

Java Conditional Constructs

Assessment

Quiz

Computers

9th - 10th Grade

Hard

Created by

Anubha Pal

Used 169+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 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

Error

Hello world

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of above statement-

5

No output

6

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. If a, b and c are the sides of a triangle then which of the following statement is true for:

if(a==b && a==c && b==c)?

Equilateral triangle

Scalene triangle

Isosceles triangle

All of the above

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a switch case, when the switch value does not respond to any case then the execution transfers to:

break

default

loop

none

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Condition is essentially formed using:

Arithmetic operators

Relational operators

Logical operators

None

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?