APCSP Algorithm (MCQ)
star
star
star
star
star
Last updated 3 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
Select all that is true!!
Select all that is true!!
1
Which of the following variable names would be considered valid in most programming languages but not self-identifying in purpose?
Which of the following variable names would be considered valid in most programming languages but not self-identifying in purpose?
1
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?
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?
1
What is the result of the expression 15 MOD 4 * 3? (Assume CSP’s MOD has precedence similar to multiplication)
What is the result of the expression 15 MOD 4 * 3? (Assume CSP’s MOD has precedence similar to multiplication)
1
Given the list grades ← [90, 85, 70, 100], what will DISPLAY(grades[2]) output if list indexing starts at 1?
Given the list grades ← [90, 85, 70, 100], what will DISPLAY(grades[2]) output if list indexing starts at 1?
1
If you have a list called names and want to add an item to the end of the list, which function would you use?
If you have a list called names and want to add an item to the end of the list, which function would you use?
1
Which of the following statements correctly describes an algorithm that uses REPEAT UNTIL x = 10?
Which of the following statements correctly describes an algorithm that uses REPEAT UNTIL x = 10?
1
In a nested conditional structure, which statement is true about the IF conditions?
In a nested conditional structure, which statement is true about the IF conditions?
1
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
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
1
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
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
1
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
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
1
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
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
1
What will DISPLAY(sum / count) output if sum ← 25 and count ← 0?
What will DISPLAY(sum / count) output if sum ← 25 and count ← 0?
1
A problem is said to be undecidable if:
A problem is said to be undecidable if:
1
What is the primary purpose of using parameters in a procedure?
What is the primary purpose of using parameters in a procedure?
1
If a procedure has a RETURN statement, what happens to the value when the procedure is called?
If a procedure has a RETURN statement, what happens to the value when the procedure is called?
1
Which of the following is a benefit of modularity in programming?
Which of the following is a benefit of modularity in programming?
1
Briefly differentiate between parameters and attributes
Briefly differentiate between parameters and attributes
1
name = "John"print(type(name))
When I run the code, what is printed to the screen?
name = "John"
print(type(name))
When I run the code, what is printed to the screen?