COMP SCI Unit 2 #7

Quiz
•
Computers
•
11th Grade
•
Easy
Nick Nessralla
Used 20+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 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)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Directions: The question or incomplete statement below is followed by four suggested answers or completions. Select the one that is best in each case.
A flowchart is a way to visually represent an algorithm. The flowchart below is used by an apartment rental Web site to set the variable to for apartments that meet certain criteria.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The diagram below shows a circuit composed of two logic gates labeled OR and AND. Each gate takes two inputs and produces a single output.
If the inputs A and C are both true, which of the following best describes the output of the AND gate?
The output will be true no matter what the value of input B is.
The output will be false no matter what the value of input B is.
The output will be true if input B is true; otherwise it will be false.
The output will be false if input B is true; otherwise it will be true.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment.
Which of the following initial values of the variable y would result in the variable z being set to 2 after the code segment is executed?
1
2
3
4
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Three words are stored in the variables word1, word2, and word3. The values of the variables are to be updated as shown in the following table.
Which of the following code segments can be used to update the values of the variables as shown in the table?
temp ← word1
word3 ← word1
word1 ← temp
temp ← word1
word1 ← word3
word3 ← temp
temp ← word1
word1 ← word2
word2 ← word3
word3 ← temp
temp ← word3
word3 ← word2
word2 ← word1
word1 ← temp
6.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
The following table shows the value of expression based on the values of input1 and input2.
Which of the following expressions are equivalent to the value of expression as shown in the table?
Select two answers.
(NOT input1) OR (NOT input2)
(NOT input1) AND (NOT input2)
NOT (input1 OR input2)
NOT (input1 AND input2)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A programmer wants to determine whether a score is within 10 points of a given target. For example, if the target is 50, then the scores 40, 44, 50, 58, and 60 are all within 10 points of the target, while 38 and 61 are not.
Which of the following Boolean expressions will evaluate to true if and only if score is within 10 points of target ?
(score ≤ target + 10) AND (target + 10 ≤ score)
(target + 10 ≤ score) AND (score ≤ target - 10)
(score ≤ target - 10) AND (score ≤ target + 10)
(target - 10 ≤ score) AND (score ≤ target + 10)
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
File Handling in Python

Quiz
•
11th - 12th Grade
10 questions
Programming - Arrays

Quiz
•
2nd - 12th Grade
10 questions
Programming - Variables & Constants

Quiz
•
4th - 12th Grade
10 questions
Programming - Algorithms in Pseudocode & Flow Diagrams

Quiz
•
1st - 12th Grade
12 questions
C# Arrays

Quiz
•
9th - 12th Grade
10 questions
Linear and Binary Search Algorithms

Quiz
•
11th Grade
10 questions
AP CSP Review

Quiz
•
9th - 12th Grade
10 questions
Comp Sci unit 3 #6

Quiz
•
11th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade