Log in
Sign up for FREE
arrow_back
Library

APCSP Algorithm (MCQ)

star
star
star
star
star
Last updated 5 months ago
19 questions
Note from the author:
Remember AP CSP is language agnostic, that is no specific langauge in mind.
Remember AP CSP is language agnostic, that is no specific langauge in mind.
4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Question 1
1.

Select all that is true!!

Question 2
2.

Which of the following variable names would be considered valid in most programming languages but not self-identifying in purpose?

Question 3
3.

If a variable num is set to 10.5, if precision is needed which data type would best represent it in a language that supports int, float, and double?

Question 4
4.

What is the result of the expression 15 MOD 4 * 3? (Assume CSP’s MOD has precedence similar to multiplication)

Question 5
5.

Given the list grades ← [90, 85, 70, 100], what will DISPLAY(grades[2]) output if list indexing starts at 1?

Question 6
6.

If you have a list called names and want to add an item to the end of the list, which function would you use?

Question 7
7.

Which of the following statements correctly describes an algorithm that uses REPEAT UNTIL x = 10?

Question 8
8.

In a nested conditional structure, which statement is true about the IF conditions?

Question 9
9.

age = 23

def change():
#global age
age += 3

change()
print(age)

Is age within the change function global or local? What will be printed to the screen

Question 10
10.

age = 23

def change():
#global age
age = 3

change()
print(age)

Is age within the change function global or local? What will be printed to the screen

Question 11
11.

age = 23

def change():
global age
age = 3

change()
print(age)

Is age within the change function global or local? What will be printed to the screen

Question 12
12.

If a function calculateDiscount(price) modifies price inside but does not return any value, which of the following statements is correct? Assume we have a price variable already created before the function

Question 13
13.

What will DISPLAY(sum / count) output if sum ← 25 and count ← 0?

Question 14
14.

A problem is said to be undecidable if:

Question 15
15.

What is the primary purpose of using parameters in a procedure?

Question 16
16.

If a procedure has a RETURN statement, what happens to the value when the procedure is called?

Question 17
17.

Which of the following is a benefit of modularity in programming?

Question 18
18.

Briefly differentiate between parameters and attributes

Question 19
19.

name = "John"
print(type(name))

When I run the code, what is printed to the screen?