Back Summary

Session #9

Multiple choice: 15/15 correct ยท Short answer: 0/0 answered · completed Sep 7, 2026

Answers

What is the main purpose of a data definition?

✓ To document how problem-domain information is represented as program data

Which chain best matches the design principle in the notes?

✓ Information structure -> data structure -> template structure -> function structure

When is an enumeration appropriate?

✓ When information is one of a fixed number of distinct cases

Which type comment describes an inclusive integer interval from 1 through 32?

✓ Integer[1,32]

What is the template shape for an atomic non-distinct type such as CityName is String?

✓ A single body placeholder using the value

What makes an itemization different from a simple enumeration?

✓ At least one subclass is not a single distinct value

How does cond choose an answer?

✓ It evaluates questions in order and uses the answer for the first true question

Why might an itemization cond use (and (number? c) (<= 1 c) ...)?

✓ To guard numeric operations so they are not applied to non-numbers

Why can the last numeric subclass sometimes be tested with only (number? c)?

✓ Because the type comment guarantees that any legal remaining number belongs to that subclass

What does it mean that HtDF and HtDD are orthogonal?

✓ The function-design recipe remains largely the same while different data definitions supply different templates

If LetterGrade has exactly "A", "B", and "C", how many main cond branches should its template have?

✓ 3

What is the interpretation in a data definition for?

✓ To state how the represented data corresponds to information in the problem domain

A function consumes SeatNum defined as Integer[1,32]. Is 50 a legal input according to the data definition?

✓ No because it is outside the SeatNum interval

Which statement correctly distinguishes purpose from interpretation?

✓ Purpose belongs to function design; interpretation belongs to data design

Why should tests for an itemization cover every subclass?

✓ Because the data definition identifies distinct forms that can drive different function behavior