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 ]
Create a free account and access millions of resources
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
20 questions
HUMANITIES and SOCIAL SCIENCES
Quiz
•
12th Grade
10 questions
Dealing with complaints
Quiz
•
1st Grade - Professio...
10 questions
Will A.I. Take My Job?
Quiz
•
9th - 12th Grade
10 questions
Camera Moves
Quiz
•
9th - 12th Grade
20 questions
Topic 1: Sectors
Quiz
•
10th Grade
18 questions
Journalism Jargon Review
Quiz
•
6th - 8th Grade
20 questions
Basic Journalism
Quiz
•
6th - 8th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Journalism
14 questions
States of Matter
Lesson
•
KG - 3rd Grade
20 questions
Disney Characters
Quiz
•
KG
20 questions
Place Value
Quiz
•
KG - 3rd Grade
7 questions
Natural Resources
Quiz
•
KG - 2nd Grade
15 questions
Pronouns
Quiz
•
KG - 3rd Grade
15 questions
Single digit addition and subtraction
Quiz
•
KG - 1st Grade
10 questions
Dichotomous Key
Quiz
•
KG - University
25 questions
Integer Operations
Quiz
•
KG - University
