
Comp Sci Unit 2 #9
Authored by Nick Nessralla
Computers
11th Grade
Used 14+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
The following spinner is used in a game. The region labeled "blue" represents 1/4 of the spinner. The regions labeled "orange" and "purple" are equal in size.
Which of the following code segments can be used to simulate the behavior of the spinner?
Select two answers.
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
In a certain game, the integer variable bonus is assigned a value based on the value of the integer variable score.
If score is greater than 100, bonus is assigned a value that is 10 times score.
If score is between 50 and 100 inclusive, bonus is assigned the value of score.
If score is less than 50, bonus is assigned a value of 0.
Which of the following code segments assigns bonus correctly for all possible integer values of score ?
Select two answers.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Ticket prices for a science museum are shown in the following table.
A programmer is creating an algorithm to display the cost of a ticket based on the information in the table. The programmer uses the integer variable age for the age of the ticket recipient. The Boolean variable includesTour is true when the ticket is for a guided tour and is false when the ticket is for general admission.
Which of the following code segments correctly displays the cost of a ticket?
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the code segment below.
If the variables onTime and absent both have the value false, what is displayed as a result of running the code segment?
Is anyone there?
Better late than never.
Hello. Is anyone there?
Hello. Better late than never.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment with integer variables x and y.
If x has a value of 7 and y has a value of 20, what is displayed as a result of executing the code segment?
ONE
TWO
THREE
FOUR
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the program below, the initial value of x is 5 and the initial value of y is 10.
What is displayed as a result of running the program?
Foxtrot
Hotel
November
Yankee
7.
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 student wrote the procedure below, which is intended to ask whether a user wants to keep playing a game. The procedure does not work as intended.
Which of the following best describes the result of running the procedure?
The procedure returns true when the user inputs the value "y" and returns false otherwise.
The procedure returns true when the user inputs the value "n" and returns false otherwise.
The procedure returns true no matter what the input value is.
The procedure returns false no matter what the input value is.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?