Skip to main content

Homework 7 — Student Demographics: Structured and Conditional Data

Skills: 4, 11, 12

Due

Thursday, October 23, 2025 at 6PM (Oakland) or 9PM (Boston)


Introduction

You're working for a university's enrollment system to track student diversity and academic information. The university wants to better understand their student body demographics. You'll be designing data structures and functions to represent and analyze student information. Throughout this assignment, you'll work with structured data definitions to represent student demographics and academic records.

Problem 1

Design a data definition called StudentRecord that represents a student with the following information:

  • Student name (String)
  • Age (Number)
  • Major (String)
  • GPA (Number)

Problem 2

Write a function generate-report that takes a StudentRecord and produces a comprehensive String report including all relevant information formatted in the following format:

Name: <Student name>
Age: <Age> years old
Major: <Major>
GPA: <GPA>

Problem 3

The university tracks student demographics using these categories:

  • International students
  • Domestic students from underrepresented groups
  • Domestic students from well-represented groups
  • Students who prefer not to disclose

Design a conditional data definition called DemographicStatus that represents these four categories. Some categories need additional information:

  • International students need their country of origin (String)
  • All domestic students need their home state (String)
  • Students who prefer not to disclose need no additional information

Problem 4

Create a new data definition StudentProfile that combines a StudentRecord with a DemographicStatus. This represents complete information about a student.

Problem 5

Design a function count-international that takes a list of StudentProfiles and returns the number of international students.

Problem 6

Design a function high-achievers takes a list of StudentProfiles and returns a list containing only students with GPA above 3.7.

Problem 6a.

You’ve noticed that the average cumulative GPAs of students in some majors consistently differ from the average cumulative GPAs of students in other majors. You wonder whether using the same GPA cutoff for determining “high-achieving” students is facially neutral but also misleading.

“Facially neutral” means something that is neutral “on its face” or “at first glance”, but perhaps unfairly biased when seen in its fuller context. For an example, consider the writer Anatole France’s sardonic observation that it’s illegal for everyone – no matter how destitute or how wealthy – to sleep under bridges, beg on the streets, or steal bread. The laws forbidding those things are facially neutral: on their face, they apply to everyone. In a fuller context, such laws seem to compound the struggles faced by destitute people, not by wealthy people.

Question: Should the cutoff cumulative GPA for “high achievers” be defined: (a) in relation to the students’ major(s), (b) regardless of a student’s major, or (c) in some other way? Explain your answer in two or three sentences.