AP CSP Review

AP CSP Review

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

 Computing Revision JCG

Computing Revision JCG

KG - University

14 Qs

Python

Python

10th - 11th Grade

10 Qs

Conditional statements

Conditional statements

9th Grade

10 Qs

Eval. 1BIM -  1ro B

Eval. 1BIM - 1ro B

7th Grade - University

15 Qs

Representing and understanding algorithms

Representing and understanding algorithms

10th - 11th Grade

10 Qs

Control Structures - Selection in Python

Control Structures - Selection in Python

8th Grade - University

11 Qs

AP Java 9-15-2023 (just functions1)

AP Java 9-15-2023 (just functions1)

9th - 12th Grade

10 Qs

Python Beginners Week 6

Python Beginners Week 6

3rd - 12th Grade

13 Qs

AP CSP Review

AP CSP Review

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Arnel Dimla

Used 68+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

Consider the following code segment to the left.

Which of the variables have the value 50 after executing the code segment?

x only

y only

x and z only

x, y, and z

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

Consider the following code segment to the left.

What is the value of r as a result of executing the code segment?

10

20

30

40

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The variable age is to be used to represent a person’s age, in years. Which of the following is the most appropriate data type for age ?

Boolean

integer

float

string

list

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

A student is creating an algorithm to display the distance between the numbers num1 and num2 on a number line. The following table shows the distance for several different values.

Which of the following algorithms displays the correct distance for all possible values of num1 and num2 ?

Step 1:

Add num1 and num2 and store the result in the variable sum.

 Step 2:    Take the absolute value of sum and display the result.

Step 1:

Subtract num1 from num2 and store the result in the variable diff.

Step 2:

Take the absolute value of diff and display the result.

Step 1:

Take the absolute value of num1 and store it in the variable absNum1.

Step 2:

Take the absolute value of num2 and store it in the variable absNum2.

Step 3:

Add absNum1 and absNum2 and display the result.

Step 1:

Take the absolute value of num1 and store it in the variable absNum1.

Step 2:

Take the absolute value of num2 and store it in the variable absNum2.

Step 3:

Subtract absNum1 from absNum2 and display the result.

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

Three words are stored in the variables word1, word2, and word3. The values of the variables are to be updated as shown in the following table.

Which of the following code segments can be used to update the values of the variables as shown in the table?

temp ← word1

word3 ← word1

word1 ← temp

temp ← word1

word1 ← word3

word3 ← temp

temp ← word1

word1 ← word2

word2 ← word3

word3 ← temp

temp ← word3

word3 ← word2

word2 ← word1

word1 ← temp

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

Consider the following procedures for string manipulation.

The variable initials is to be assigned a string consisting of the first letter of the string firstName followed by the first letter of the string lastName. Which of the following assigns the correct string to initials ?

initials ← concat(prefix(firstName, 1), prefix(lastName, 1))

initials ← concat(prefix(firstName, 2), prefix(lastName, 2))

initials ← prefix(concat(firstName, lastName), 1)

initials ← prefix(concat(firstName, lastName), 2)

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

To qualify for a particular scholarship, a student must have an overall grade point average of 3.0 or above and must have a science grade point average of over 3.2. Let overallGPA represent a student’s overall grade point average and let scienceGPA represent the student’s science grade point average. Which of the following expressions evaluates to true if the student is eligible for the scholarship and evaluates to false otherwise?

(overallGPA > 3.0) AND (scienceGPA > 3.2)

(overallGPA > 3.0) AND (scienceGPA ≥ 3.2)

(overallGPA ≥ 3.0) AND (scienceGPA > 3.2)

(overallGPA ≥ 3.0) AND (scienceGPA ≥ 3.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?