APCSP Unit 1 Variables, Random, Math Practice Questions

APCSP Unit 1 Variables, Random, Math Practice Questions

11th Grade

15 Qs

quiz-placeholder

Similar activities

X_Пон_мас_ариф

X_Пон_мас_ариф

9th - 12th Grade

10 Qs

8525 AQA GCSE 3.2.5 Boolean Operations

8525 AQA GCSE 3.2.5 Boolean Operations

10th - 11th Grade

10 Qs

Variables & Control Flow [0]

Variables & Control Flow [0]

9th - 11th Grade

10 Qs

CPA Practice 9-29-2021

CPA Practice 9-29-2021

9th - 12th Grade

19 Qs

Scratch

Scratch

8th - 12th Grade

15 Qs

Class 8 MIT Beginners

Class 8 MIT Beginners

8th Grade - University

20 Qs

GCSE Computer Science - Programming Keywords

GCSE Computer Science - Programming Keywords

9th - 12th Grade

15 Qs

Programming L1 Programming concepts - LESSON - J276 - Unit 6

Programming L1 Programming concepts - LESSON - J276 - Unit 6

10th - 12th Grade

16 Qs

APCSP Unit 1 Variables, Random, Math Practice Questions

APCSP Unit 1 Variables, Random, Math Practice Questions

Assessment

Quiz

Computers

11th Grade

Hard

Created by

Victoria Berkowitz

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A developer is creating a program that will store a user's email address and whether the user has verified their account. Which of the following variables are most appropriate for the program?

A string variable named e and a Boolean variable named v

A string variable named emailAddress and a Boolean variable named isVerified

A string variable named email and a numeric variable named verificationStatus

A string variable named userEmail and a numeric variable named verified

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment, which uses the variables x, y, and z.

x ← 4

y ← 5

z ← 6

x ← z

y ← x

DISPLAY (x)

DISPLAY (y)

What is displayed as a result of running the code segment?

4 5

5 6

6 6

6 5

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The variable amountBooks is to be used to represent the amount of books on a shelf. Which of the following is the most appropriate data type for numBooks?

Boolean

String

Number

Array

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

a ← 15

b ← a MOD c

Which of the following initial values of the variable c would result in the variable b being set to 3 after the code segment is executed?

2

3

4

5

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A die has 6 faces numbered 1 to 6. Which of the following code segments can be used to simulate rolling the die four times and assigns the sum of the values obtained by the four different rolls to the variable total?

total ← RANDOM(1, 6) + RANDOM(1, 6) + RANDOM(1, 6) + RANDOM(1, 6)

total ← RANDOM(1, 24)

total ← 4 * RANDOM(1, 6)

total ← 6 * RANDOM(1, 4)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the result of executing the code segment with variables a, b, c, and d initialized as shown?

11 30 40 55

12 35 35 50

17 45 35 60

10 25 35 50

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which code segment correctly simulates two spins of a spinner with 8 equal regions?

sum ← RANDOM(1, 8) + RANDOM(1, 8)

sum ← RANDOM(1, 16)

sum ← 2 * RANDOM(1, 8)

sum ← 8 * RANDOM(1, 2)

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?