
Java-If - If/Else
Authored by Jessica Horning
Computers
9th - 12th Grade
Used 71+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Java supports six relational operators that are used to make comparisons: =, <, >, <=, >=, =!
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Is this code segment is correct?
if(quizScore == 10)
System.out.println("Perfect score");
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
WHICH TYPE OF DECISION STRUCTURE IS THIS?
if (x==10)
{
if (y==20)
{
System.out.println("Coordinates: 10, 20");
}
}
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Of the following if statements, which one correctly executes three instructions if the condition is true?
a = b * 2;
y = x;
z = a – y;
if (x <0)
a = b*2;
y=x;
z=a-y;
}
a = b * 2;
y = x;
z = a – y;
}
{
a = b*2;
y = x;
z = a - y;
}
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the sets of statements below will add 1 to x if x is positive and subtract 1 from x if x is negative but leave x alone if x is 0?
else x--;
else if (x < 0) x--;
if (x < 0) x--;
else x = 0;
else x++;
x--;
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is wrong, logically, with the following code?if (x > 10) System.out.println("Large");else if (x > 6 && x <= 10) System.out.println("Medium");else if (x > 3 && x <= 6) System.out.println("Small");else System.out.println("Very small");
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
IF Score > Highest THEN
PRINT “NEW WORLD RECORD!”
ELSE
IF Score < Highest + 10 THEN
PRINT “GOOD PERFORMANCE”
ELSE
PRINT “AVERAGE PERFORMANCE”
END IF
END IF
If Score equals 130 and Highest equals 120, what is the output?
NEW WORLD RECORD!
AVERAGE RACE
GOOD RACE
No output.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?