
Unit 3 Review
Authored by Karen Russo
Computers
9th - 12th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
18 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
1 min • 1 pt
If a = 15 and b = 12, what is the result of the following:
if (a ==10)
{ b = b + a;
a = 5; }
else if (a > 10)
{ a = a - b;
b = a * b; }
a = _______________ b = ____________
2.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What will be the output for the following program segment?
int junk = 12;
if (junk > 5)
if (junk % 5 == 0)
System.out.println ("The value of junk is: " + junk);
else
System.out.println(("Junk is negative");
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the errors in the following if statement.
if x > 0 then System.out.println(x);
needs an == sign
No parentheses around x > 0
"then" is not used in java
No parentheses around x > 0 and "then" is not used in java
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the error in the following if statement.
if ( x = 1) { y ++;}
y ++ is not a valid statement
the curly brackets will cause a compile error
the condition should be (x == 1)
there is no else statement
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the error in the following if statement.
String word = new String("Hello");
String word2 = new String("Hello");
if (word == word2)
System.out.println("The words are the same");
else
System.out.println("The words are not the same");
it is missing curly brackets
you need to use .equals() instead of ==
you need to use = instead of ==
There is no error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the error in the following if statements.
String word = new String ("Hello");
String word2 = new String("Hello");
if (word.equals(word2));
System.out.println("The words are the same");
else
System.out.println("The words are not the same");
use == instead of .equals()
there are no curly brackets
remove the ; at the end of the if condition
use = instead of .equals()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of s if x = 5 and y = 2 after executing the following cod:
s = 0;
if (x > 0) { s++;}
if (y > 0) {s ++;}
s = 0
s = 1
s = 2
s = -2
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?
Similar Resources on Wayground
13 questions
Pengenalan Aplikasi Blender
Quiz
•
11th Grade
20 questions
Skill Competition Quiz 2024
Quiz
•
10th Grade - University
15 questions
Dasar Kompetensi Keahlian IPv6
Quiz
•
10th Grade
13 questions
LENGUAJE C
Quiz
•
11th Grade
20 questions
CSS - Operating System
Quiz
•
11th Grade
15 questions
SOAL AIJ
Quiz
•
11th Grade
15 questions
MIT APP - QUIZ
Quiz
•
10th Grade
15 questions
Security
Quiz
•
9th Grade
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade