AP · thinka-original Practice Paper

2024 AP AP Computer Science Principles Practice Paper with Answers

Thinka May 2024 AP-Style Mock — AP Computer Science Principles

6 marks60 mins2024
An original Thinka practice paper modelled on the structure and difficulty of the May 2024 AP AP Computer Science Principles paper. Not affiliated with or reproduced from AP.

Section Create Performance Task: Portfolio Components

Submit program code, personalized project reference, and a video demonstrating program input, functionality, and output.
2 Question · 2 marks
Question 1 · free-response
1 marks
Submit a video demonstration (up to 1 minute in length) illustrating the execution of your program.

Your video must demonstrate the running of your program, including:
- Input given to the program
- Program functionality in response to the input
- Output produced by the program
Show answer & marking scheme

Worked solution

To earn the point for the Video component, the submission must be an actual recording of the program running (not a slideshow, static storyboard, or series of screenshots). The video must visibly demonstrate:
1. Input: User interaction or data entry (such as clicking a button, selecting a dropdown item, entering text into a prompt box, or receiving sensor/data file inputs).
2. Program Functionality: At least one clear aspect of the program executing its algorithm or processing the supplied input.
3. Output: The visual, audible, or textual result generated and displayed to the user or device as a consequence of the execution.

Marking scheme

Award 1 point if the video demonstrates the running of the program including:
- Input
- Program functionality
- Output

Decision Rules / Guidance:
- Consider the video (or Program Code if necessary to clarify the source of input) when scoring this point.
- The video needs to show at least one example of the program's functionality.

Do NOT award credit if:
- The video does not show a demonstration of the program running (e.g., screenshots or storyboards are submitted instead of a screen recording/video).
- The video fails to demonstrate input, program functionality, or output.
Question 2 · Program Code Requirements
1 marks
Refer to your Personalized Project Reference when answering this question.

Consider the procedure identified in part (i) of the Procedure section of your Personalized Project Reference.

(a) Identify the name and parameter(s) of the procedure.

(b) Describe how the procedure uses both selection and iteration to accomplish its purpose in the program.
Show answer & marking scheme

Worked solution

To earn the point, the response must:
1. Identify the procedure name and its explicit parameter(s) as shown in the Personalized Project Reference.
2. Accurately describe what the iteration structure does (e.g., traverses a list or repeats a specific calculation for a set range) and how the selection statement (e.g., an `if` or `if/else` block) evaluates a condition inside or alongside the loop to alter the flow of execution or process elements conditionally.

Marking scheme

Award 1 point if the written response meets both of the following criteria:
- Explicitly identifies the student-developed procedure name and its parameter(s).
- Explains the specific role and operation of both the selection statement and the iteration statement within the procedure body to accomplish the program's intended goal.

Do NOT award the point if:
- The procedure does not contain both selection and iteration.
- The description merely lists lines of code without explaining the algorithm's functionality.
- The parameters identified are arguments or global variables rather than formal parameters defined in the procedure header.

Ready to test yourself?

Turn these notes into exam-style practice. Get unlimited AI questions on this topic with instant marking and explanations.

Practise This Topic

Section II: Written Response Prompts

Using your Personalized Project Reference sheet, answer the four written response prompts covering program design, algorithm development, errors/testing, and abstraction.
4 Question · 4 marks
Question 1 · free_response
1 marks
Identify the overall purpose of your program. Explain how a specific visual or textual output produced by your program directly supports this purpose for the user.
Show answer & marking scheme

Worked solution

### Sample Exemplar Response:

Program Purpose:
"The purpose of my program is to assist high school track-and-field athletes in calculating and monitoring their split times to help them optimize their pacing strategies for long-distance events."

Explanation of Output:
"When the athlete inputs their total target time and number of laps, the program outputs a formatted table listing the target split time for each individual lap along with a visual color-coded indicator (green for on pace, yellow for slight deviation, red for major deviation) based on their recorded practice times. This textual and visual output directly supports the program's purpose by immediately giving the runner clear, actionable feedback on which segments of their race need pacing adjustments."

(Note: Student responses will vary depending on their individual Create task project.)

Marking scheme

### Scoring Criteria (0–1 point)

Award 1 point if the written response:
- Identifies the overall purpose of the program (i.e., the problem being solved or creative interest being pursued).
- Explains how a specific visual or textual output produced by the program supports the identified purpose.

Decision Rules:
- Consider the Video (or Program Code if necessary) and Written Response 1 when scoring this point.
- The response must distinguish between the purpose of the program (why it exists / the goal for the user) and the functionality of the program (how it executes / code-level actions).
- The identified output can be graphical, auditory, numerical, or textual.

Do NOT award a point if any of the following is true:
- The response describes program functionality instead of the broader purpose.
- The output described is not produced by the program or is implausible/inconsistent with the program.
- The response fails to connect the identified output to how it helps achieve the stated purpose.
Question 2 · free-response
1 marks
Refer to your Personalized Project Reference when answering this question.

Consider the first conditional statement included in the Procedure section of your Personalized Project Reference.

Identify the Boolean condition used in this conditional statement and explain what action or process the procedure performs when this Boolean condition evaluates to `true`.
Show answer & marking scheme

Worked solution

To earn the point, the response must:
1. Identify the Boolean expression of the first conditional statement in the Procedure section (e.g., `userScore >= targetScore`).
2. Provide an accurate general description of what the procedure accomplishes or how the program state updates when that Boolean expression evaluates to `true` (e.g., incrementing the level counter, displaying a victory message to the user, and updating the leaderboard list).

Marking scheme

Award 1 mark if the written response:
- Identifies the Boolean expression within the first conditional statement located in the Procedure section of the Personalized Project Reference.
- Accurately describes what occurs during program execution when the identified Boolean expression evaluates to `true`.

Do NOT award the mark if:
- No conditional statement is present in the Procedure section of the Personalized Project Reference.
- The description of the Boolean expression does not match the student's code.
- The response merely recites or copies lines of code word-for-word without providing a meaningful description of functionality.
- The described functionality is implausible, incorrect, or contradictory to the provided code.
Question 3 · free-response
1 marks
Refer to your Personalized Project Reference when answering this question.

Consider the procedure identified in part (i) of the Procedure section of your Personalized Project Reference.

Identify two distinct test cases for your procedure that test different execution paths or conditions within the algorithm. For each test case:
- State the specific argument value(s) passed in the procedure call.
- Describe the expected outcome or result (such as a return value, screen update, or variable modification).

If your procedure does not have multiple execution paths or cannot produce different outcomes, explain why two such test cases are not possible for your procedure.
Show answer & marking scheme

Worked solution

Sample Complete Response:

Test Case 1:
- Procedure Call / Argument(s): `calculateDiscount(120, "VIP")`
- Expected Outcome: The conditional check `if membership == "VIP"` evaluates to true, applying a 20% discount. The procedure returns `96.0` and updates the display text to show the discounted price of $96.00.

Test Case 2:
- Procedure Call / Argument(s): `calculateDiscount(120, "REGULAR")`
- Expected Outcome: The conditional check for VIP is false, executing the `else` branch which applies a standard 5% discount. The procedure returns `114.0` and updates the display text to show the price of $114.00.

Alternative Scenario (Single Path):
If the procedure simply calculates a mathematical transformation without any selection (e.g., `calculateArea(length, width)` which returns `length * width`), the student explains: "The procedure performs only sequential multiplication without conditional statements, meaning all calls execute the exact same sequence of statements regardless of the arguments passed."

Marking scheme

Award 1 point if the written response demonstrates ALL of the following criteria:
1. Identifies two calls to the student-developed procedure with specific argument values (or sets of values) that cause different code segments/branches to execute.
2. Accurately describes the expected output, return value, or observable behavior for each call.
OR
Explains clearly and accurately why it is not possible to write two calls that execute different code paths based on the structure of the procedure in the Personalized Project Reference.

Do NOT award credit if:
- The response describes calls to two different procedures rather than two calls to the same procedure.
- Arguments provided do not match the parameters defined in the procedure header.
- The described expected outcomes are inaccurate, implausible, or inconsistent with the provided code.
Question 4 · free_response
1 marks
Refer to your Personalized Project Reference when answering this question.

Consider the list identified in the List section of your Personalized Project Reference.

(i) Identify the name of your list and describe the type or meaning of the data elements stored within it.

(ii) Explain how using this list manages complexity in your program compared to an alternative implementation that does not utilize a list or collection data structure. Your explanation must specifically describe how your program code would have to be written differently without using the list.
Show answer & marking scheme

Worked solution

Sample Complete Response:

(i) The list in my program is named `highScoresList`, which stores integer values representing the top scores achieved by players across multiple game rounds.

(ii) Using `highScoresList` manages complexity by allowing a single variable to store an arbitrary number of scores and enabling automated traversal using loops. Without this list, my program would require separate individual variables for each score (e.g., `score1`, `score2`, `score3`, etc.). Furthermore, operations such as finding the maximum score or displaying rankings would require extensive, repetitive chains of conditional statements (`if-else`) rather than a concise iteration statement over the list. This would make the program significantly longer, harder to read, error-prone to maintain, and incapable of dynamically handling varying amounts of score entries.

Marking scheme

Award 1 point for a written response that meets ALL of the following criteria:
• Identifies the list name and accurately describes the data stored in the list.
• Explains how the list manages complexity in the program by contrasting it with a plausible alternative implementation without a list (e.g., requiring multiple individual variables, repetitive conditional code, difficulty in maintenance, or inability to scale dynamically).

Do NOT award the point if any of the following is true:
• The list is not identified or is not present in the List section of the Personalized Project Reference.
• The explanation confuses data abstraction (lists) with procedural abstraction (procedures/functions) without addressing how the list itself manages complexity.
• The response provides only vague or generic statements (e.g., 'it makes my code shorter') without specifically describing what the code would look like without the list.

Wondering how well you actually know this?

thinka is an AI practice app for DSE students: unlimited questions, instant auto-marking, and detailed step-by-step solutions. 100,000+ students use it to confirm they actually know it, not just think they do.

Want more questions like this? Practise unlimited on thinka, instant answers included.

Start Practising Free