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
15 questions
APCSP Cumulative Test 2

Quiz
•
9th - 12th Grade
10 questions
RO81 LO2 The role of the client

Quiz
•
9th - 11th Grade
10 questions
Technology Knowledge

Quiz
•
9th - 12th Grade
10 questions
Guess the Logo

Quiz
•
KG - University
10 questions
GETTING ACQUAINTED WITH ANIMATE

Quiz
•
11th Grade
15 questions
QUIZ 4 EMPOWERMENT TECHNOLOGY

Quiz
•
11th Grade
15 questions
Bebras 2014

Quiz
•
7th - 12th Grade
10 questions
uCertify SDA Chapter 9 Mid-Chapter Quiz

Quiz
•
8th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade