Unit 2: Data
CS Principles · Unit 2 · Paper 2

Data unit test

A test on this unit alone, marked as a percentage and a letter grade — for the test your class is actually sitting, rather than for May. Answer everything, then submit once: seeing the answer to question 3 before attempting question 4 makes the final percentage meaningless.

Each paper is built from this unit’s 36 terms and is the same for everyone, so a teacher can assign “Unit 2, Paper 2” and every student sits the identical test. Multiple choice is marked objectively; the written sections you mark yourself against the model answer and rubric.
Suggested time 33 min 30 points0/17 attempted
1

Bias in a program

2

Why digital data is discrete

3

Sound as binary

4

Metadata

5

Personally identifiable information (PII)

6

Abstraction

7

Data cleaning

8

Open data

9

Images as binary

10

Why large datasets need programs

11

Number of values in n bits

12

Round-off error

Short answer 1. Define or explain: Bias in data collection

3 pts

Short answer 2. Define or explain: Overflow vs round-off

3 pts

Short answer 3. Define or explain: Text as binary

3 pts

Short answer 4. Define or explain: Analog vs digital data

3 pts

Free response

6 pts

This course has no free-response prompt tagged to this unit, so one from elsewhere in the course is used. It is still worth writing — the skill transfers.

A team is writing a program that repeatedly needs the average of a list of numbers: once for quiz scores, once for homework scores, and once for attendance percentages. Their first draft copies the same six lines of code into three places.

Write a procedure average(numbers) in AP-style pseudocode that returns the average of the values in a list, returning 0 for an empty list. List indexes begin at 1.

Explain how defining this procedure manages the complexity of the program.

Explain the role of the parameter and of the return value, and why the procedure is more useful with a parameter than if it always used one fixed global list.

The team then wants a procedure highestAverage that takes three lists and returns the largest of their averages. Describe how it should be written, and name the abstraction it depends on.