AP CSP 3.2 Exercise 2: One Name for Many

Big Idea 3 · Topic 3.2 · Exercise 2

One Name for Many

25 minutes - 5 designs - separate variables or a list, and why

Back to the Topic 3.2 lessonAll CSP topics

How this page works

The writing boxes below are yours. What you type stays in this browser, is saved here as you go, and is never sent to us or to your teacher. Hand the written work in the way your teacher asked for it.

The graded check at the bottom is the part that records to your teacher's gradebook.

The cases, from your handoutNot recorded

The same cases as your handout, in the same order.

Scenario 1 · Foundational

A program tracks the daily high temperature for every day of a month so it can later find the hottest day and the average.

Better design (separate variables / list) and why this is one collection or not:

How it manages complexity (one name / easier to develop & maintain / works for any size):

Enrichment - a subtler abstraction consideration (mixed types, copying, the array name):

Scenario 2 · Core

A game program stores a single player's current health and, separately, the current level number. These two values are unrelated and used in different parts of the code.

Better design (separate variables / list) and why this is one collection or not:

How it manages complexity (one name / easier to develop & maintain / works for any size):

Enrichment - a subtler abstraction consideration (mixed types, copying, the array name):

Scenario 3 · Core

A quiz app currently uses grade1, grade2, grade3, ... grade30 for a class of 30 students, and the teacher wants to add a 31st student mid-semester.

Better design (separate variables / list) and why this is one collection or not:

How it manages complexity (one name / easier to develop & maintain / works for any size):

Enrichment - a subtler abstraction consideration (mixed types, copying, the array name):

Scenario 4 · Challenge

A weather record must store, for one day, a mix of values: the location name ("Denver"), the high temperature (91), and whether it rained (false).

Better design (separate variables / list) and why this is one collection or not:

How it manages complexity (one name / easier to develop & maintain / works for any size):

Enrichment - a subtler abstraction consideration (mixed types, copying, the array name):

Scenario 5 · Challenge

A program has a list masterScores and needs a separate working copy it can experiment with, so that changes to the copy do not disturb the original list.

Better design (separate variables / list) and why this is one collection or not:

How it manages complexity (one name / easier to develop & maintain / works for any size):

Enrichment - a subtler abstraction consideration (mixed types, copying, the array name):

No graded check on this page yetNot recorded

About the line in your handout

Your handout says this exercise is available online and auto-graded. The exercise IS here, and it is the same work in the same order, but the auto-graded half is not written for this topic yet. Nothing on this page is scored or sent to your teacher.

Hand this in the way your teacher asked for it. Topic 1.1 has its graded check today, and the rest follow.

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.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]