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.
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.
12 questions
BJC Unit 2 Concepts Review
Quiz
•
10th Grade - University
10 questions
Comp Sci Unit 2 #9
Quiz
•
11th Grade
10 questions
Data Handling in Python
Quiz
•
11th Grade
15 questions
Computer Science - Python
Quiz
•
9th - 12th Grade
10 questions
Code.org Unit 5 - Loops
Quiz
•
9th - 12th Grade
15 questions
Java Script Quiz
Quiz
•
9th - 12th Grade
10 questions
Year 9 Programming Constructs
Quiz
•
1st - 12th Grade
10 questions
Unit 4 Advanced AP CSP
Quiz
•
9th - 12th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University