COMP SCI Unit 2 #7

COMP SCI Unit 2 #7

11th Grade

10 Qs

quiz-placeholder

Similar activities

Programming C#

Programming C#

11th Grade

10 Qs

ITC: 1-3 Secure IT: Protect Your Privacy

ITC: 1-3 Secure IT: Protect Your Privacy

11th Grade

11 Qs

Computational Thinking

Computational Thinking

9th - 11th Grade

10 Qs

Code.org Unit 5 Test

Code.org Unit 5 Test

11th Grade

15 Qs

AP CSP Review

AP CSP Review

9th - 12th Grade

10 Qs

File Handling in Python

File Handling in Python

11th - 12th Grade

10 Qs

Search Algorithms

Search Algorithms

9th - 12th Grade

10 Qs

Programming - Algorithms in Pseudocode & Flow Diagrams

Programming - Algorithms in Pseudocode & Flow Diagrams

1st - 12th Grade

10 Qs

COMP SCI Unit 2 #7

COMP SCI Unit 2 #7

Assessment

Quiz

Computers

11th Grade

Easy

Created by

Nick Nessralla

Used 20+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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

Media Image

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.

Media Image
Media Image
Media Image
Media Image

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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

Media Image

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

Media Image

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

Media Image

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?