CodeHS Quiz: Boolean Expressions and if Statements

CodeHS Quiz: Boolean Expressions and if Statements

KG

15 Qs

quiz-placeholder

Similar activities

The Guardian Representation

The Guardian Representation

11th Grade

12 Qs

Development Decades

Development Decades

University - Professional Development

10 Qs

Journalism

Journalism

4th - 6th Grade

10 Qs

Types of Feature Article

Types of Feature Article

10th Grade

15 Qs

Week 2 - Comm 1301

Week 2 - Comm 1301

University

15 Qs

Happy Independence Day

Happy Independence Day

8th - 12th Grade

15 Qs

Journalism 9

Journalism 9

9th Grade

10 Qs

Check-Up Quiz

Check-Up Quiz

7th - 8th Grade

10 Qs

CodeHS Quiz: Boolean Expressions and if Statements

CodeHS Quiz: Boolean Expressions and if Statements

Assessment

Quiz

Journalism

KG

Practice Problem

Easy

Created by

Gracie Rosky

Used 8+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

  1. To do something only if a condition is true

  1. 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

  1. if boolean expression { // code to execute // code to execute }


  1. if(boolean expression) { // code to execute // code to execute }

  1. 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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?