CS 101 Lecture Notes

Week Ten, Wednesday/Thursday: Data Modeling and Data Structures

Typedef Demonstration Program

The "typedef" reserved word is used to define new data type names. See the source code for an example. When compiled, the demo program produces the following result:


Program execution.

Program Example: Club Membership Data

Suppose you wanted to create a computer program to keep track of club members. You first need to model the data you need to store. The highest level of abstraction is the club itself which consists of a set of club members. Each member has a name, an address, and an amount owed in club dues (if any), and so on. One such model could be constructed as follows:


Date data model.


Address data model.


Person data model.


Club member data model.

The model is implemented in source code using the C "struct" as shown in this source code. When the source code is compiled and run, the following result is obtained:


Program execution.


This page established March 16, 1999; last updated March 14, 2019.