AP CSP Unit 7: Parameters, Returns, and Libraries
Quiz
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Medium
Erin Torres
Used 1K+ times
FREE Resource
About this resource
This quiz covers Advanced Placement Computer Science Principles Unit 7, focusing on functions, parameters, return values, and programming libraries. Designed for grades 9-12, the content emphasizes procedural abstraction and modular programming concepts essential for developing complex software systems. Students must demonstrate mastery of function syntax, parameter passing, return statements, and API usage while understanding how libraries simplify program development. The questions require knowledge of JavaScript programming fundamentals including modulo operations, conditional logic, loops, and array manipulation. Core reasoning skills include tracing code execution, analyzing function behavior, identifying appropriate test cases, and understanding the relationship between parameters and arguments. Students need to comprehend how procedural abstraction manages complexity through code reuse and modularity, while recognizing the benefits of using existing algorithms as building blocks for new solutions. Created by Erin Torres, a Computers teacher in US who teaches grade 9-12. This comprehensive assessment serves multiple instructional purposes including formative evaluation of student understanding, homework assignments, and review preparation for the AP Computer Science Principles exam. Teachers can utilize individual questions as warm-up activities to reinforce daily lessons or deploy the complete quiz for unit assessment. The varied question formats—from code completion to conceptual understanding—provide excellent practice for students preparing for both multiple-choice and performance task components of the AP exam. This quiz aligns with College Board standards for CSP Unit 7, specifically addressing learning objectives related to procedural abstraction (AAP-3), algorithm implementation (AAP-2), and the role of libraries in program development (CRD-2). The inclusion of vocabulary matching questions reinforces essential terminology while coding problems develop practical programming skills necessary for success in advanced computer science coursework.
See more
Enhance your content in a minute
26 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which code segment results in "true" being returned if a number is even? Replace "MISSING CONDITION" with the correct code segment.
function isEven(num){
if(MISSING CONDITION){
return true;
} else {
return false;
}
}
num % 2 == 0;
num % 0 == 2;
num % 1 == 0;
num % 1 == 2;
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Here is the API for a robot library.
// moves the robot forward
function moveForward();
// turns the robot to the left
function rotateLeft();
// turns the robot to the right
function rotateRight();
// checks if a robot can move in any direction
// direction {string} - the direction to be checked
// return {Boolean} - true if the robot can move in that direction, otherwise returns false
function canMove(direction);
Which code segment will guarantee that the robot makes it to the gray square without hitting a wall or a barrier (black square)?
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be printed to the console after this program runs?
var numbers = [2, 5, 3, 1, 6]
function changeNums(numList, addNum, subtractNum){
for(var i=0; i<numList.length; i++){
if(numList[i] % 3 == 0){
numList[i] = numList[i] + addNum;
} else {
numList[i] = numList[i] - subtractNum;
}
}
}
changeNums(numbers, 3, 2);
console.log(numbers);
[2, 5, 3, 1, 6]
[0, 3, 6, -1, 9]
[-1, 2, 6, -2, 8]
[5, 2, 6, 3, 9]
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which function calls would provide the most helpful test of this function?
Remember: With tests, you are attempting to figure out all the possible ways the function could be broken.
function findMin(num1, num2){
if(num1 < num2){
return num1;
} else {
return num2;
}
}
findMin(-1, 0)
findMin(2,4)
findMin(5,10)
findMin(5,3)
findMin(7,2)
findMin(5,1)
findMin(1,1)
findMin(-2,2)
findMin(0,3)
findMin(-1,1)
findMin(1,-1)
findMin(1,1)
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
You have imported a library with the birthMonth() function. Based on the API, how many strings are inputed to calculate the birth month?
// calculate birth month based on the day of the month, day of the week, and the birth year
// dayMonth {number} - a day of a month from 1 to 31
// dayWeek {string} - the name of the day of the week
// year {number} - the birth year
// return {string} - the month you were born
BirthdayLibrary.birthMonth(dayMonth, dayWeek, year);
1
4
0
3
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
listAverage() returns the average number in a list. Which of these functions does this correctly?
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is printed to the console?
console.log(15 % 4);
2
3
4
1
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
22 questions
Year 10 Inkscape lesson 5 and 6 formative test
Quiz
•
10th Grade
22 questions
Steve Jobs
Quiz
•
6th - 12th Grade
22 questions
1.2.4 Data Storage - OCR
Quiz
•
9th - 10th Grade
21 questions
Visual Basic Assessment
Quiz
•
11th - 12th Grade
21 questions
Photoshop & Typography Checkpoint
Quiz
•
9th Grade
22 questions
Networks: End of Unit Quiz
Quiz
•
7th - 9th Grade
21 questions
Artificial Intelligence
Quiz
•
9th - 12th Grade
21 questions
Set Up an IT System Revision
Quiz
•
11th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
