CodeHS Quiz: Boolean Expressions and if Statements
Quiz
•
Journalism
•
KG
•
Practice Problem
•
Easy
Gracie Rosky
Used 8+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a relational operator?
<
?
==
>=
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this Java expression evaluate to?
80 >= 80
"true"
true
false
This expression will error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the code snippet below.
String name = "Karel"; String checkName = new String("Karel"); boolean nameMatches = name == checkName;
true
false
Cannot be determined
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between == and =?
== is used for assignment, while = is used to check for equality
= is used for assignment, while == is used to check for equality.
== assigns values to objects while = assigns values to primitives.
There is no difference. These symbols can be used interchangeably.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following symbols is the “not equal” symbol?
==
not =
!=
<>
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why do we use if statements in Java?
To break out of some block of code
To do something only if a condition is true
To do something while a condition is true
To repeat something for a fixed number of times
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which if statement is written properly?
if (boolean expression): // code to execute // code to execute
if boolean expression { // code to execute // code to execute }
if(boolean expression) { // code to execute // code to execute }
if boolean expression [ // code to execute // code to execute ]
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
What's the Good Word
Quiz
•
5th - 8th Grade
10 questions
#NameItClaimIt
Quiz
•
10th Grade
15 questions
Understanding Newsworthiness
Quiz
•
6th Grade
20 questions
HUMANITIES and SOCIAL SCIENCES
Quiz
•
12th Grade
13 questions
Communication
Quiz
•
University
10 questions
Dealing with complaints
Quiz
•
1st Grade - Professio...
10 questions
Camera Moves
Quiz
•
9th - 12th Grade
18 questions
Boboiboy galaxy
Quiz
•
1st 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
Discover more resources for Journalism
20 questions
Place Value
Quiz
•
KG - 3rd Grade
6 questions
3.3 Magnets
Quiz
•
KG
20 questions
Ch. 7 Quadrilateral Quiz Review
Quiz
•
KG - University
12 questions
HOMOPHONES
Lesson
•
KG - 4th Grade
10 questions
Long i- igh, ie, and y Quiz
Quiz
•
KG - 3rd Grade
12 questions
Quarter Past, Half Past, and Quarter To
Quiz
•
KG - 12th Grade
20 questions
Capitalization in sentences
Quiz
•
KG - 4th Grade
14 questions
Reference Sources
Lesson
•
KG - 3rd Grade
