Data Abstraction FRQ Practice

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

Question 1 of 5

A cafeteria program tracks three lunch counts.

(a) Propose a list name that supports clear data abstraction. (b) Explain one benefit of that list versus three disconnected variables. (c) Give one statement that displays the second element of your list (1-indexed).

Question 2 of 5

PROCEDURE countEven(nums) returns how many even values appear in list nums. Callers do not see the body.

(a) What is being abstracted for the caller? (b) List two things a caller must know to use the procedure correctly. (c) List one thing a caller need not know.

Question 3 of 5

Argue from the table which design better matches data abstraction for a deck of cards.

Design Details
1 52 separately named variables card01 ... card52
2 One list named deck

(a) Choose design 1 or 2 and justify using abstraction language. (b) Describe how drawing the top card could be expressed using your chosen design. (c) Explain whether abstraction means the program can never look at a single card.

Question 4 of 5

A student claims data abstraction and procedural abstraction are unrelated.

(a) Give one sentence connecting them when a procedure processes a named list. (b) Provide a short pseudocode call example. (c) Explain what remains hidden in your example.

Question 5 of 5

You inherit code that uses a list named raw without comments.

(a) Why does a vague name weaken data abstraction for human readers? (b) Suggest a better name if the list stores daily rainfall totals in millimeters. (c) Does renaming the list change the stored numbers? Explain.