
Unit 3 If statements Quiz
Authored by Karen Russo
Computers
9th - 12th Grade
Used 10+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
13 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Pick the value that best completes the sentence: A boolean variable has _______ value(s).
only one valid
two valid
three valid
only invalid
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What mathematical symbol/word does the symbol && in java represent?
and
or
average
absolute value
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the symbol ! mean in a boolean expression?
Always use 0 for x
Always true
Never true
Not
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
If x = 5, y = 10 and z = 10, the expression
(x < y) && !(y ==z)
will return the value of _______________.
true
false
null
cannot be determined
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output for the following program segment?
int num = 20;
if (num > 0)
if (num % 5 == 0)
System.out.println(num);
else System.out.println(num + " is negative ");
20
4
4 is negative
20 is negative
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What line of code would replace the following algebraic inequality?
-3 < x || x < 5
-3 <= x || x < 5
-3 < x && x < 5
-3 < = x && x < 5
7.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
Consider the following code assuming the variables have been properly defined.
String mystery_word = new String ("Comp Sci ");
System.out.println ("Enter a word ");
String word = reader.nextLine();
// compare the word to the mystery word
if (*** line of code goes here ****)
System.out.println ( "your word matches");
else
System.out.println ("The words do not match");
What is the proper code to compare the two words?
! (word.equals(mystery_word))
! ( word == mystery_word)
(word.equals(mystery_word))
(word == mystery_word)
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
10 questions
QBASIC Programming
Quiz
•
5th - 10th Grade
10 questions
hardware and software(g3)
Quiz
•
2nd - 10th Grade
15 questions
KD 3.1_Aplikasi Pengolah Angka / Spreadsheet
Quiz
•
10th Grade
10 questions
JSPS Competition Hackathon - Scratch Language - Grade 1
Quiz
•
2nd Grade - University
10 questions
Microcontroller
Quiz
•
11th Grade - University
10 questions
Anime
Quiz
•
KG - University
10 questions
Tin học 10 _ Bài 16 _Định dạng văn bản
Quiz
•
10th - 12th Grade
10 questions
TIN 11 - PYTHON - PHÉP TOÁN - BIỂU THỨC - CÂU LỆNH GÁN
Quiz
•
11th 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
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade