Computer Science Principles Practice Exam: Comprehensive Notes
Computer Science Principles Practice Exam Notes
Important Note
- Practice Exam provided by the College Board for AP Exam preparation.
- Teachers can download and make copies for classroom use only.
- Teachers must collect all materials after administration and keep them secure.
- Exams cannot be posted on websites or electronically redistributed.
- Distribution outside the secure College Board site is prohibited.
- Violations may result in termination of Practice Exam access.
About the College Board
- Mission-driven not-for-profit connecting students to college success.
- Founded in 1900 to expand access to higher education.
- Membership association of over 6,000 leading educational institutions.
- Dedicated to promoting excellence and equity in education.
- Annually helps over seven million students prepare for college.
- Programs and services include the SAT® and Advanced Placement Program®.
- Serves the education community through research and advocacy.
- Visit www.collegeboard.org for more information.
AP® Equity and Access Policy
- Educators should make equitable access a guiding principle for AP programs.
- All willing and academically prepared students should have the opportunity to participate.
- Encourage the elimination of barriers restricting access for underrepresented groups.
- Schools should ensure AP classes reflect the diversity of their student population.
- All students should have access to academically challenging coursework before AP.
- Equitable preparation and access are essential for true equity and excellence.
Contents
- Introduction
- Practice Exam:
- Exam Content and Format
- Administering the Practice Exam
- Answer Sheet for Multiple-Choice Questions
- AP® Computer Science Principles Practice Exam
- Notes on the Practice Exam:
- Introduction
- Multiple-Choice Questions
- Answers to Multiple-Choice Questions
Introduction
- AP Computer Science Principles Exam measures student achievement of course learning objectives.
- Assesses application of computational thinking practices and understanding of big ideas.
- Exam questions may assess multiple learning objectives and content from multiple essential knowledge statements.
- May include nontextual stimulus material like diagrams and charts.
- Features multiple-choice questions: single-select or multiple-select (two answer choices).
- Assessment consists of a through-course assessment (40% of AP score) and an end-of-course AP Exam (60% of AP score).
- Through-course assessment: two performance tasks, digital artifacts, and written responses via a web-based portal.
- End-of-course exam: 74 multiple-choice questions.
- This practice exam prepares for the end-of-course exam only.
- Part I: AP Computer Science Principles Practice Exam (mirrors actual AP Exam).
- Part II: Notes on the AP Computer Science Principles Practice Exam (explanation of question links to curriculum framework and multiple-choice rationales).
How AP Courses and Exams Are Developed
- Designed by committees of college faculty and AP teachers.
- Ensure each AP course and exam reflects and assesses college-level expectations.
- Define the scope and expectations through a curriculum framework.
- Informed by data from colleges and universities to reflect current scholarship.
- Committees design and approve exam specifications and questions connected to the curriculum framework.
- AP Exam development: multiyear process with review, revision, piloting, and analysis.
- Ensures high-quality, fair questions with an appropriate range of difficulty.
Methodology Guiding Course and Exam Development
- Course and exam developed using similar methodologies.
- Course design: principles from Understanding by Design.
- Exam design: evidence-centered design approach.
- Processes begin by identifying end goals (student knowledge and abilities).
- Statements about knowledge/abilities and observable evidence serve as learning objectives for the course and targets of measurement for the exam.
- Course and exam share the same foundation.
Course Development
- Committee articulates high-level goals before specific learning objectives.
- Consistent with “backward design” (curricula, instruction, and assessments with the end goal in mind).
- Learning objectives describe what students should know and be able to do.
- Provides clear instructional goals and targets of measurement for the exam.
Exam Development
- Committee decides on overall exam nature.
- Exam specifications cover learning objectives, content/skills distribution, number of multiple-choice questions, and time allocation.
- Assessment specialists design questions conforming to specifications.
- Committee reviews every question for alignment with curriculum framework and accuracy.
- Exam questions are piloted in AP classrooms to determine statistical properties.
- Approved and piloted questions are included in an exam.
- Final review ensures overall conformity with specifications.
How AP Exams Are Scored
- Scoring process uses expertise of AP teachers and college faculty.
- Multiple-choice questions are machine-scored; performance assessments are scored by college faculty and AP teachers at the annual AP Reading.
- AP Exam Readers are thoroughly trained and monitored for fairness and consistency.
- Chief Reader (respected college faculty member) maintains accuracy of scoring standards, along with AP Readers in leadership positions.
- Performance assessment scores are weighted and combined with multiple-choice results.
- Composite score is converted into an AP Exam score of 5, 4, 3, 2, or 1.
- Score-setting process: precise and labor-intensive, involving psychometric analyses.
- Alignment with college-level standards: comparing AP student performance with college students in comparable courses.
- AP composite score points set so that the lowest raw score for an AP score of 5 is equivalent to the average score among college students earning grades of A.
- AP Exam scores of 4 are equivalent to college grades of A–, B+, and B.
- AP Exam scores of 3 are equivalent to college grades of B–, C+, and C.
Using and Interpreting AP Scores
- Extensive work ensures AP Exam scores accurately represent student achievement in the equivalent college course.
- Colleges and universities set their own credit and placement policies.
- AP scores signify how qualified students are to receive college credit and placement.
- AP Score Recommendation:
- 5: Extremely well qualified
- 4: Well qualified
- 3: Qualified
- 2: Possibly qualified
- 1: No recommendation
- Additional resources: apcentral.collegeboard.org.
Practice Exam Exam Content and Format
- The AP Computer Science Principles Exam is 2 hours in length and consists of 74 multiple-choice questions.
Administering the Practice Exam
- Resembles an actual administration:
- You will be given 2 hours to answer 74 multiple-choice questions. Each question has four answer choices.
- For question numbers 1 through 66, mark only the single best answer to each question.
- For the remaining questions, numbered 67 through 74, mark the two best answer choices for each question.
- Your total score on this multiple-choice exam is based only on the number of questions answered correctly. Points are not deducted for incorrect answers or unanswered questions. When you do not know the answer to a question, you should eliminate as many choices as you can, and then select the best answer among the remaining choices. If you finish before time is called, you may check your work.
- Programming reference materials are located at the front of the exam. The reference materials provide instructions and explanations to help you understand the format and meaning of the questions on the test. As you encounter programming questions on the test, you should use the reference materials to clarify the behavior of programming statements found in those questions.
- You have 2 hours for this exam. Open your exam booklet and begin.
- Note Start Time
- Note Stop Time
- Stop working. The exam is over. I will now collect your exam materials.
- Collect an exam booklet and answer sheet from each student.
Programming Reference Materials
- Programming instructions use four data types: numbers, Booleans, strings, and lists.
- Instructions may include:
- Assignment, Display, and Input
- Arithmetic Operators and Numeric Procedures
- Relational and Boolean Operators
- Selection
- Iteration
- List Operations
- Procedures
- Robot
- Assignment:
- Text:
a ← expression - Block: [Assignment Block Diagram]
- Evaluates expression and assigns the result to variable
a.
- Display:
- Text:
DISPLAY (expression) - Block: [Display Block Diagram]
- Displays the value of
expression, followed by a space.
- Input:
- Text:
INPUT () - Block: [Input Block Diagram]
- Accepts a value from the user and returns it.
Arithmetic Operators and Numeric Procedures
- Arithmetic Operators:
- Text and Block:
a + b, a - b, a * b, a / b - Perform arithmetic on
a and b. For example, 3 / 2 evaluates to 1.5.
- Modulo Operator:
- Text and Block:
a MOD b - Evaluates to the remainder when
a is divided by b. Assume that a and b are positive integers. For example, 17 MOD 5 evaluates to 2.
- Random Number Generator:
- Text:
RANDOM (a, b) - Block: [Random Block Diagram]
- Evaluates to a random integer from
a to b, including a and b. For example, RANDOM (1, 3) could evaluate to 1, 2, or 3.
Relational and Boolean Operators
- Relational Operators:
- Text and Block:
a = b, a ≠ b, a > b, a < b, a >= b, a <= b - Used to test the relationship between two variables, expressions, or values. For example,
a = b evaluates to true if a and b are equal; otherwise, it evaluates to false.
- Boolean NOT Operator:
- Text:
NOT condition - Block: [NOT Block Diagram]
- Evaluates to
true if condition is false; otherwise, evaluates to false.
- Boolean AND Operator:
- Text:
condition1 AND condition2 - Block: [AND Block Diagram]
- Evaluates to
true if both condition1 and condition2 are true; otherwise, evaluates to false.
- Boolean OR Operator:
- Text:
condition1 OR condition2 - Block: [OR Block Diagram]
- Evaluates to
true if condition1 is true or if condition2 is true or if both condition1 and condition2 are true; otherwise, evaluates to false.
Selection
IF (condition) {
<block of statements>
}
- Block: [IF Block Diagram]
- The code in
<block of statements> is executed if the Boolean expression condition evaluates to true; no action is taken if condition evaluates to false. - Text:
IF (condition) {
<first block of statements>
} ELSE {
<second block of statements>
}
- Block: [IF-ELSE Block Diagram]
- The code in
<first block of statements> is executed if the Boolean expression condition evaluates to true; otherwise, the code in <second block of statements> is executed.
Iteration
REPEAT n TIMES {
<block of statements>
}
- Block: [REPEAT n TIMES Block Diagram]
- The code in
<block of statements> is executed n times. - Text:
REPEAT UNTIL (condition) {
<block of statements>
}
- Block: [REPEAT UNTIL Block Diagram]
- The code in
<block of statements> is repeated until the Boolean expression condition evaluates to true.
List Operations
- For all list operations, if a list index is less than 1 or greater than the length of the list, an error message is produced and the program terminates.
- Accessing List Element:
- Text:
list[i] - Block: [List Element Block Diagram]
- Refers to the element of
list at index i. The first element of list is at index 1.
- Assigning List Element:
- Text:
list[i] ← list[j] - Block: [List Assignment Block Diagram]
- Assigns the value of
list[j] to list[i].
- Creating a List:
- Text: Not applicable (list creation is typically done with assignment).
- Block:
list ← [value1, value2, value3] - Assigns
value1, value2, and value3 to list[1], list[2], and list[3], respectively.
- FOR EACH Loop (List Traversal):
FOR EACH item IN list {
<block of statements>
}
- Block: [FOR EACH Block Diagram]
- The variable
item is assigned the value of each element of list sequentially, in order from the first element to the last element. The code in <block of statements> is executed once for each assignment of item.
List Operations (Continued)
- Inserting into a List:
- Text:
INSERT (list, i, value) - Block: [INSERT Block Diagram]
- Any values in
list at indices greater than or equal to i are shifted to the right. The length of list is increased by 1, and value is placed at index i in list.
- Appending to a List:
- Text:
APPEND (list, value) - Block: [APPEND Block Diagram]
- The length of
list is increased by 1, and value is placed at the end of list.
- Removing from a List:
- Text:
REMOVE (list, i) - Block: [REMOVE Block Diagram]
- Removes the item at index
i in list and shifts to the left any values at indices greater than i. The length of list is decreased by 1.
- Getting List Length:
- Text:
LENGTH (list) - Block: [LENGTH Block Diagram]
- Evaluates to the number of elements in
list.
Procedures
PROCEDURE name (parameter1, parameter2, ...) {
<instructions>
}
- Block: [Procedure Definition Block Diagram]
- A procedure,
name, takes zero or more parameters. The procedure contains programming instructions.- Procedure with Return Value:
- Text:
PROCEDURE name (parameter1, parameter2, ...) {
<instructions>
RETURN (expression)
}
- Block: [Procedure with Return Value Block Diagram]
- A procedure,
name, takes zero or more parameters. The procedure contains programming instructions and returns the value of expression. The RETURN statement may appear at any point inside the procedure and causes an immediate return from the procedure back to the calling program.
Robot
- If the robot attempts to move to a square that is not open or is beyond the edge of the grid, the robot will stay in its current location and the program will terminate.
- Move Forward:
- Text:
MOVE_FORWARD () - Block: [MOVE_FORWARD Block Diagram]
- The robot moves one square forward in the direction it is facing.
- Rotate Left:
- Text:
ROTATE_LEFT () - Block: [ROTATE_LEFT Block Diagram]
- The robot rotates in place 90 degrees counterclockwise (i.e., makes an in-place left turn).
- Rotate Right:
- Text:
ROTATE_RIGHT () - Block: [ROTATE_RIGHT Block Diagram]
- The robot rotates in place 90 degrees clockwise (i.e., makes an in-place right turn).
- Can Move (Direction):
- Text:
CAN_MOVE (direction) - Block: [CAN_MOVE Block Diagram]
- Evaluates to
true if there is an open square one square in the direction relative to where the robot is facing; otherwise, evaluates to false. The value of direction can be left, right, forward, or backward.
Multiple-Choice Questions
Question 1
- Code segment uses
r, s, and t. - What is displayed?
- (C) 2 3
Question 2
- Which is a true statement about program documentation?
- (D) Program documentation is useful during initial program development and also when modifications are made to existing programs.
Question 3
- What happens when a new device is connected to the Internet?
- (B) An Internet Protocol (IP) address is assigned to the device.
Question 4
- Which replacement for
<MISSING CONDITION> results in an infinite loop? - (A) j = 6
Question 5
- Coin flip simulation algorithm.
- Expression indicates equal number of heads and tails?
- (D) heads_counter = 2
Question 6
- Algorithm to sum even integers in a list.
- What programming structure must be added?
- (C) Selection
Question 7
- Which poses the greatest personal cybersecurity risk?
- (C) Reserving a hotel room by e-mailing a credit card number to a hotel
Question 8
- Code segment with IsFound procedure.
- Best describes contents of resultList?
- (B) Only elements that appear in both inputList1 and inputList2
Question 9
- Factors affecting ability to process large data sets?
- (B) How many programming statements the program contains
Question 10
- Least likely to indicate a phishing attack?
- (A) An e-mail from your bank asks you to call the number on your card to verify a transaction
Question 11
- Considered an unethical use of computer resources?
- (C) Purchasing a single-user copy of photo editing software and installing it on all the computers in a computer lab
Question 12
- Statements true about using a high-level programming language?
I. Easier for people to read.
II. Provides more abstractions.
III. Easier to debug. - (D) I, II, and III
Question 13
- Lower sound quality of saved song.
- (A) The song was saved using fewer bits per second than the original song.
Question 14
- Program intended to display number of times target appears in a list.
- (A) The program correctly displays the number of times target appears in the list.
Question 15
- Given initial values of
x and y, what is displayed? - (C) November
Question 16
- Program draws line segments
Draw(length, direction). - Which figure is drawn?
Question 17
- Expression to determine eligibility for an academic award (numberOfAbsences
- (B) numberOfAbsences = 5, gradePointAverage = 3.8
Question 18
- Computer searching for patterns, which is NOT an example of this?
- (C) A high school analyzing student grades to identify the students with the top ten highest grade point averages
Question 19
- Positive number
num shows