
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
20 questions
Quiz 4
Quiz
•
1st - 10th Grade
20 questions
2324tx6
Quiz
•
9th - 12th Grade
15 questions
# REVIEW 1 DATA TYPES
Quiz
•
10th Grade
15 questions
1.1.1 The structure and function of the processor
Quiz
•
11th Grade - University
20 questions
Network topologies
Quiz
•
8th Grade - University
15 questions
Quiz 1
Quiz
•
1st - 12th Grade
18 questions
LATIHAN INFORMATIKA
Quiz
•
9th Grade
15 questions
CSS Quarter IV QUIZ 2
Quiz
•
10th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade