
11AE-CSC60-SBQ1
Authored by Computer Teacher
Other
11th Grade
Used 6+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
1) What are the two parts of an if statement?
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
2) Which of the following statements is true about the if statement?
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
3) Which of the following statements is correct about an if statement?
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax for an if statement?
if (x < 10) { size = "Small"; } else (x < 20) { size = "Medium"; }
if (x < 10); { size = "Small"; } else (x < 20) { size = "Medium"; }
if (x < 10)
{ size = "Small";
}
else
{
size = "Medium";
}
if { size = "Small"; } else (x < 20) { size = "Medium"; }
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assuming that the user provides 303 as input, what is the output of the following code snippet? int x; int y; x = 0; Scanner in = new Scanner(System.in); System.out.print("Please enter a number: "); y = in.nextInt(); if (y > 300) { x = y; } else { x = 0; } System.out.println("x: " + x);
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assuming that the user provides 99 as input, what is the output of the following code snippet? int a; int b; a = 0; Scanner in = new Scanner(System.in); System.out.print("Please enter a number: "); b = in.nextInt(); if (b > 300) { a = b; } else { a = 0; } System.out.println("a: " + a);
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following code snippet contains an error. What is the error? if (cost > 100); { cost = cost – 10; } System.out.println("Discount cost: " + cost);
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?