Data Abstraction FRQ Practice

Responses receive AI feedback against a rubric after submission. Scores are practice estimates.

Question 1 of 5

A fitness app stores seven daily step counts.

(a) Explain one benefit of placing them in a list named weekSteps rather than seven unrelated variables. (b) Give one example of a task that is easier with the list name. (c) Does using a list prevent reading an individual day? Explain briefly.

Question 2 of 5

A procedure is documented as: PROCEDURE firstItem(list) returns the value at index 1 of list.

(a) What must a caller provide? (b) What need the caller not know? (c) Write one assignment that stores the result of calling firstItem on a list named colors into a variable named lead.

Question 3 of 5

Compare the designs in the table.

Design Description
A Variables sensorA, sensorB, sensorC
B List named sensors holding the three readings

(a) Which design better supports data abstraction for a collection? Justify. (b) Name one program change that is easier in design B. (c) Give one way a programmer still works with details inside design B.

Question 4 of 5

An authoring tool exposes PROCEDURE shuffle(playlist) that reorders a list of song titles.

(a) Describe what data abstraction is happening for the caller. (b) If the tool later changes the shuffle algorithm but keeps the same procedure name and effect, what stays true for existing callers? (c) Why is that change management an advantage of abstraction?

Question 5 of 5

A student says: "If I use a list name, I am not allowed to think about indexes."

(a) Is that statement accurate? Explain. (b) Give an example where both the list name and an index are useful together. (c) Restate what data abstraction actually aims to hide.