AP CSP Boolean Logic 4

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Michael Toepper
Used 14+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Given the procedure:
What will be displayed after the following statement is executed?
DISPLAY ( adjustCount (9) + adjustCount (16) )
28
32
33
35
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Two grids are shown. Each grid contains a robot represented as a triangle. Both robots are initially facing left. Each robot can move into a white or gray square, but cannot move into a black region.
For each grid, the program below is intended to move the robot to the gray square. The program uses the procedure Goal_Reached ( ), which evaluates to true if the robot is in the gray square and evaluates to false otherwise.
For which of the grids does the program correctly move the robot to the gray square?
Grid I only
Grid II only
Both Grid I and Grid II
Neither Grid I nor Grid II
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A programmer named Johnny has a programming style in which he does not like to indent his code. Here is an example of a procedure Johnny recently created.
It is supposed to return "ELEPHANT" if the type of animals is "E", "GIRAFFE" if the type of animal is "G" and the height is "TALL", or "GORILLA" if the type of animal is "G" and the height is "AVERAGE". If none of these conditions are true, then return "UNKNOWN".
Does this procedure always return the correct animal as specified above?
Yes, this procedure returns the correct value for all test cases.
No, this procedure will not return the correct value if the animal type is "G" and height is "AVERAGE".
No, this procedure will not return the correct value if the animal type is "E" and height is "AVERAGE".
No, this procedure will not return the correct value if the animal type is "G" and height is "TALL".
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
An office building has two floors. A computer program is used to control an elevator that travels between the two floors. Physical sensors are used to set the following Boolean variables.
The elevator moves when the door is closed and the elevator is called to the floor that it is not currently on.
Which of the following Boolean expressions can be used in a selection statement to cause the elevator to move?
(onFloor1 AND callTo2) AND (onFloor2 AND callTo1)
(onFloor1 AND callTo2) OR (onFloor2 AND callTo1)
(onFloor1 OR callTo2) AND (onFloor2 OR callTo1)
(onFloor1 OR callTo2) OR (onFloor2 OR callTo1)
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the code segment.
If the variables onTime and absent both have the value false, what is displayed as a result of running the code segment?
Is anyone there?
Better late than never.
Hello. Is anyone there?
Hello. Better late than never.
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A game programmer uses this nested conditional in their online Four Square game.
When mouseX is 173 and mouseY is 199, what will be the value of currentSquare?
1
2
3
4
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
The diagram below shows a circuit with three gates, where the output from two AND gates are sent into an OR gate. The circuit has four inputs (A, B, C, D), two for each AND gate.
If the final output is 0, what is a possible state of the inputs A/B/C/D?
A = 0, B = 0, C = 0, D = 0
A = 1, B = 1, C = 0, D = 1
A = 0, B = 1, C = 1, D = 1
A = 1, B = 0, C = 1, D = 1
Create a free account and access millions of resources
Similar Resources on Wayground
9 questions
Robot While Loop Questions

Quiz
•
9th - 12th Grade
14 questions
Robotics Quiz

Quiz
•
5th - 9th Grade
10 questions
Introduction to Artificial Intelligence

Quiz
•
9th Grade
8 questions
APCSP Big Idea 3 Review

Quiz
•
10th - 12th Grade
5 questions
AP CSP 3.5 Boolean Expressions Pt. 2

Quiz
•
9th - 12th Grade
15 questions
Robotics and Arduino Quiz1 Hope

Quiz
•
10th Grade
14 questions
Robotics

Quiz
•
9th - 12th Grade
10 questions
Quiz de Robótica Industrial

Quiz
•
9th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade