Comp Sci Quiz #6

Quiz
•
Computers
•
11th Grade
•
Easy
Nick Nessralla
Used 15+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Assume that the Boolean variable hot is assigned the value true and the Boolean variable humid is assigned the value false. Which of the following will display the value true ?
Select two answers.
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.
The ticket prices at a movie theater are given below.
A programmer is creating an algorithm to set the value of ticketPrice based on the information in the table. The programmer uses the integer variable age for the age of the moviegoer. The Boolean variable is3D is true when the movie is 3-D and false otherwise.
Which of the following code segments correctly sets the value of ticketPrice?
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The cost of a customer’s electricity bill is based on the number of units of electricity the customer uses.
For the first 25 units of electricity, the cost is $5 per unit.
For units of electricity after the first 25, the cost is $7 per unit.
Which of the following code segments correctly sets the value of the variable cost to the cost, in dollars, of using numUnits units of electricity?
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment.
What is the value of sum after the code segment is executed?
12
14
16
18
5.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
In a certain video game, players are awarded bonus points at the end of a level based on the value of the integer variable timer. The bonus points are awarded as follows.
If timer is less than 30, then 500 bonus points are awarded.
If timer is between 30 and 60 inclusive, then 1000 bonus points are awarded.
If timer is greater than 60, then 1500 bonus points are awarded.
Which of the following code segments assigns the correct number of bonus points to bonus for all possible values of timer ?
Select two answers.
6.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Assume that the Boolean variable x is assigned the value true and the Boolean variable y is assigned the value false. Which of the following will display the value true ?
Select two answers.
7.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
In a certain video game, the variable maxPS represents the maximum possible score a player can earn. The maximum possible score depends on the time it takes the player to complete the game. The value of maxPS should be 30 if time is greater than 120 and 50 otherwise.
Which of the following code segments correctly sets the value of maxPS based on the value of time ?
Select two answers.
Create a free account and access millions of resources
Similar Resources on Wayground
14 questions
Python Syntax

Quiz
•
6th - 12th Grade
11 questions
Python Boolean

Quiz
•
11th - 12th Grade
12 questions
Java Strings

Quiz
•
9th - 12th Grade
12 questions
BJC Unit 2 Concepts Review

Quiz
•
10th Grade - University
10 questions
Python Variables

Quiz
•
7th - 12th Grade
10 questions
Code.org Unit 5 Vocab Quiz 1

Quiz
•
9th - 12th Grade
10 questions
Comp Sci Unit 2 #9

Quiz
•
11th Grade
10 questions
Data Handling in Python

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