AP CSP Create Task Practice - Build Up to All Six Requirements
AP CSP · Create Performance Task · Coding Practice
Create Task Practice - Six Requirements, One Program
You have written 72 pieces of a program. The Create Task wants one program that holds six things at once. These four problems add them one at a time.
Problem 1 of 4
Requirements in this problem: 2 of 6
Your program is being sent two lines: a name, then a step goal. Read both, then print exactly Ada is aiming for 8000 steps a day. Do not type the name or the number into your code. Read them, or this problem has taught you nothing.
Expected output: Ada is aiming for 8000 steps a day.
Show AP pseudocode reference
name ← INPUT() goal ← INPUT() DISPLAY(name + " is aiming for " + goal + " steps a day.")
Input sent to your program
Ada 8000
input() returns one line as a string, already without its newline. In JavaScript the four starter lines do the same job: call INPUT() once per line. Both give you a string, so you can join them straight onto the sentence without converting anything.Problem 2 of 4
Requirements in this problem: 4 of 6
A week of step counts is already in your starter code. Your program is being sent one line: the goal. Read it, then go through the list and work out two things, how many days went over the goal and which day was the highest. Print exactly two lines: Days over goal: N then Best day: N. Read the goal as a number, not a string.
Expected output: Days over goal: 3Best day: 12030
Show AP pseudocode reference
goal ← INPUT()
steps ← [6200, 9100, 7450, 12030, 8000, 5300, 10400]
over ← 0
best ← 0
FOR EACH day IN steps
{
IF(day > goal)
{
over ← over + 1
}
IF(day > best)
{
best ← day
}
}
DISPLAY("Days over goal: " + over)
DISPLAY("Best day: " + best)Input sent to your program
8000
"8000" compares as a string until you convert it. Use int(...) in Python or Number(...) in JavaScript. Then watch the boundary: one day in the list is exactly 8000, and 8000 is not over 8000. If you get 4 instead of 3, you wrote >= where the prompt said over.Problem 3 of 4
Requirements in this problem: 6 of 6
Same list, same week. Now write a procedure daysOverGoal(dayList, goal) that takes the list and a goal as parameters, loops through the list, counts the days over that goal, and returns the count. Read one goal from input, then call your procedure twice: once with the goal you were sent, once with 10000. Print Days over 8000: N then Days over 10000: N, using the goal you read rather than a typed 8000.
Expected output: Days over 8000: 3Days over 10000: 2
Show AP pseudocode reference
PROCEDURE daysOverGoal(dayList, goal)
{
over ← 0
FOR EACH day IN dayList
{
IF(day > goal)
{
over ← over + 1
}
}
RETURN(over)
}
goal ← INPUT()
steps ← [6200, 9100, 7450, 12030, 8000, 5300, 10400]
DISPLAY("Days over " + goal + ": " + daysOverGoal(steps, goal))
DISPLAY("Days over 10000: " + daysOverGoal(steps, 10000))Input sent to your program
8000
if both move inside the procedure. That is the whole point: the scored requirement is an algorithm with selection and iteration living inside a procedure you wrote, not next to it. The procedure returns a number and prints nothing, so both printed lines happen outside it. If your two lines show the same count, you probably ignored the goal parameter and used the input variable inside the procedure instead.Problem 4 of 4
Requirements detected: 0 of 6
Now your own program, on your own topic, and nothing here is checked against a right answer because there is not one. Write something small that does all six: takes input, stores something in a list, has a procedure with a parameter that contains both an if and a loop, calls that procedure, and prints output. Edit the input box below to whatever your program should be sent. When you run it you get your real output plus a reading on all six requirements.
No expected output. This one is checked on the six requirements, not on what it prints.
Show AP pseudocode reference
PROCEDURE yourProcedure(aList, aValue)
{
FOR EACH item IN aList
{
IF(some test)
{
do something
}
}
RETURN(result)
}
thing ← INPUT()
aList ← [ your data ]
DISPLAY(yourProcedure(aList, thing))Input sent to your program (edit this)
Now write the real one
The Create Task Builder is the same six-requirement check with a proper editor, a Java option, and room for the whole program. Your work here does not carry over, so take your problem 4 code with you.
Open the Create Task BuilderYour code runs on a secure external service. Nothing you write or type here is stored.
Get in Touch
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
Prefer email? Reach me directly at [email protected]