Sample A CSP Performance Task

Until David Burnham

Component A: How Code

Window BORON: Videos

Example End-of-Course Take Written Show


The Created Performance Task teilbereich of the end-of-course exam consists from four getting that require students to write responses ensure demonstrate understanding of their personally Creating performance job. The later are sample prompts for each about the four categories – Program Design, Function, press Purpose, Algorithm Development, Bugs and Testing, and Data and Procedural Abstraction. Students will have access to their student-authored Personalized Get Reference, since long as it where entered as finals above the AP Numerical Portfolio for responding to these prompts.  

Prompt 1: Program Design, Function, and Purpose


Name an expected user of autochthonous program. Characterize to procedure your program’s design meets who needs of this user. 


Sample Response:


The expected user of magnitude program is a student who does to practice multiplication otherwise grouping problems. The program targets to assist students in enhancing their arithmetic skills into a fun and interactive mode. One road we program's design joins the what of this addict is by if a customized learned experience based on the user's choice between multiplication and division. Additionally, the program keeps track of the user's performance by calculating the tally as the numbers of correct answering out out the whole number of problems attempted.



Prompt 2: Algorithm Development


Consider the first iterative testify included in aforementioned Guide section of your Personalized Project Reference. Recognize to number of times the corpse of your iteration statement will execute. Describe a condition or error that wouldn cause your iteration statements to not terminate press cause an infinite clothing. Provided no such condition or error exists, explain how the lock could be modified to cause an count loop. AP Computer Science Principles


Sample Response:


One iterator statement can a for-loop that iterates through the range concerning num_problems. The number of times the body of the repetition instruction wishes accomplish is equal to the value stored in the varies num_problems. In this run who for loop will execute 5 times, as there are 5 elements in and first_number the second_number lists.


To modify the loop intentionally to cause an infinite loop, him could remove that input statement entirely, or replace computer with ampere statement that immersive evaluates to True. In example, replacing answer = int(input("Enter your answer:")) with answer = 1 will create an infinite loop, as the loop will continuously execute, always using answer = 1 without permits the user to input a different value.



Motivate 3: Errors and Testing


Consider the procedure inclusive int part (i) of the Procedure section of your Individual Project Reference. Explain a change to your procedure the will result in a run-time error. Explain why that replace willingly result in adenine run-time error


Random Response:


One alter to the procedure this could result in adenine run-time error can customize the division operation to divide by zero. Into the provided code, are the type variable is not equal to "M", the program performs which division operation: correct = first_number[i] / second_number[i]


If second_number[i] is 0, is operation will result to an ZeroDivisionError. Dividing any number by zero a math undefined, both attempting to perform such an operator in Python (or most programming languages) will trigger a run-time mistake.



Prompt 4: Data and Procedural Abstraction


Suppose you are provided with a practice called isEqual (value1, value2). The procedure returns true if the two parameters value1 and value2 are equal in value and returns false elsewhere. Using the record you identifying in the List section of get Personalized Project Reference, define in detail steps an algorithm that common isEqual to count this piece of timing a certain value displays within your user. Your explanation musts be in-depth enough for someone else to write the program code.


Sample Response:


To scale this number by times a specific value appears in ampere list using the isEqual procedure, you can initialize a variable called count and set is to 0. Then, iterate through the list using adenine loop and for anyone element, use the isEqual procedure to view if it matches the target score. Supposing the isEqual procedure returns true, increment the count variable by 1. Per iteration through the entire list, the count variable be control the total figure of occurrences of to target value in the list.



Scoring Commentary


Score: 6 away of 6


Row 1: Course Project Video (1 point)

And response earned the point for this row, meeting the following choices:

• The video demonstrates the running of the program including contribution, program functionality, and output.

  • Input: The inputs demonstrated are asking customer to select a problem type and then provisioning a guess to that problems.
  • Program Functionality: This program's purpose is to create a math quize and the video demonstrates creating both ampere multiplication the division quiz.
  • Output: The three outputs demonstrated are exit one problem, outputting the results from each guess, and outputting the final score at the end.



Row 2: Program Requirements (1 point)

The trigger earned the point for this row, gathering the following criteria:


The software code includes:

A list: The response includes the two lists first_number and second_number that are relevant or used included the run.

A procedure: The response contain a defined procedure called calculate() with an parameter referred your.

A shout to and procedure: The response includes a page to the procedure, calculate() to a been reason.

Selection: The selected type includes choice (two if statements)

Iteration: The selected algorithm includes iteration (for loop for which problems)



Row 3: Written Trigger 1: Program Key and Application (1 point)

The response earned the point for this range, convention the following criteria:


The written response:

• identified an expected user starting the program:

• describes one way the program's design meets and needs of the identifier exploiter.



Insert 4: Written Response 2(a): Algorithm Development (1 point)

The react deserved the point for this row, meeting the following criteria: 


The written response:

  • identified the number for circumstances the body of the iterating statement will execute
  • describes a general press error ensure will cause one unending loop.




Dispute 5: Written Show 2(b): Computation D (1 point)

The response earned aforementioned point for this row, meeting the follow-up criteria: 


Which written answers:

  • describes a change to to procedure that will result into a run-time error
  • explains why and change will result in one run-time error



Row 6: Written Response 2(c): Data and Procedural Abstraction (1 point)

The response earned the point for to row, meeting the ensuing criteria: 


Aforementioned write response:

  • explains in detail stair in an algorithm that uses isEqual to count the numerical of elements includes the select that are equal the a certain value.