Comp Sci Quiz #6

Comp Sci Quiz #6

11th Grade

10 Qs

quiz-placeholder

Similar activities

Python Programming Basics

Python Programming Basics

7th - 11th Grade

12 Qs

Javascript

Javascript

10th - 12th Grade

15 Qs

Python - Conditionals

Python - Conditionals

9th - 12th Grade

12 Qs

Basics in Java

Basics in Java

9th - 12th Grade

15 Qs

Study Guide - More Advanced Java

Study Guide - More Advanced Java

11th - 12th Grade

10 Qs

AP Computer Science Principles - Unit 4: Variables, Conditionals

AP Computer Science Principles - Unit 4: Variables, Conditionals

9th - 12th Grade

10 Qs

Python Boolean and If

Python Boolean and If

9th - 12th Grade

10 Qs

Python: Functions and Parameters

Python: Functions and Parameters

9th - 12th Grade

10 Qs

Comp Sci Quiz #6

Comp Sci Quiz #6

Assessment

Quiz

Computers

11th Grade

Easy

Created by

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.

Media Image
Media Image
Media Image
Media Image

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.

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?

Media Image
Media Image
Media Image
Media Image

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?

Media Image
Media Image
Media Image
Media Image

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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.

Media Image
Media Image
Media Image
Media Image

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.

Media Image
Media Image
Media Image
Media Image

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.

Media Image
Media Image
Media Image
Media Image

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?