Comp Sci Unit 2 #9

Comp Sci Unit 2 #9

11th Grade

10 Qs

quiz-placeholder

Similar activities

Code.org Discoveries

Code.org Discoveries

9th - 11th Grade

10 Qs

N5 SDD - Python input and output

N5 SDD - Python input and output

7th - 11th Grade

12 Qs

J277 Programming - Outputting Data

J277 Programming - Outputting Data

9th - 11th Grade

10 Qs

Y6 - Programming A - Variables in games

Y6 - Programming A - Variables in games

6th Grade - University

10 Qs

Python variables and Data types

Python variables and Data types

10th - 12th Grade

10 Qs

Thunkable Intro!

Thunkable Intro!

9th - 12th Grade

13 Qs

Variables in coding pt. 1

Variables in coding pt. 1

9th - 12th Grade

12 Qs

Unit 1 Review AP CSP

Unit 1 Review AP CSP

9th - 12th Grade

10 Qs

Comp Sci Unit 2 #9

Comp Sci Unit 2 #9

Assessment

Quiz

Computers

11th Grade

Easy

Created by

Nick Nessralla

Used 14+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Media Image

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.

Media Image
Media Image
Media Image
Media Image

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.

Media Image
Media Image
Media Image
Media Image

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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?

Media Image
Media Image
Media Image
Media Image

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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

Media Image

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

Media Image

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

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 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.

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?