Chapter 5-Boolean Expressions and If Statements-Ch 5 Rev. Drill

Chapter 5-Boolean Expressions and If Statements-Ch 5 Rev. Drill

9th - 12th Grade

2 Qs

quiz-placeholder

Similar activities

GCSE Year 10 Representation Recap

GCSE Year 10 Representation Recap

9th - 12th Grade

7 Qs

Understanding HTML Structure

Understanding HTML Structure

9th Grade

7 Qs

Variabile globale

Variabile globale

12th Grade

6 Qs

Intro to HTML Quiz

Intro to HTML Quiz

12th Grade

6 Qs

Quiz 2 - HTML Tag Quiz - Lists

Quiz 2 - HTML Tag Quiz - Lists

9th Grade

7 Qs

Operatorii și expresiile

Operatorii și expresiile

11th Grade

7 Qs

operators

operators

9th Grade

7 Qs

AP CSP Practice

AP CSP Practice

10th - 12th Grade

6 Qs

Chapter 5-Boolean Expressions and If Statements-Ch 5 Rev. Drill

Chapter 5-Boolean Expressions and If Statements-Ch 5 Rev. Drill

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

THOMAS HARRIS

FREE Resource

AI

Enhance your content in a minute

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

2 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment:

for (int i = 200; i > 0; i /=3)

{

if (i % 2 == 0)

System.out.print (i + " ") ;

}

What is the output as a result of executing the code segment?

(A) 200 66 22 7 2

(B) 66 22 7 2

(C) 200 66 22 2

(D) 200 66 22

(E) 7

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. Suppose p and q are declared as boolean variables and have been initialized to unknown truth values.

What does the following boolean expression evaluate to?

(p && ! q) | | (p && q)

(A) The expression always evaluates to the same value as p.

(B) The expression always evaluates to the same value as q.

(C) The expression always evaluates to the same value as true.

(D) The expression always evaluates to the same value as false.

(E) The expression only evaluates to true if p and q have opposite truth values.