
Lesson 10-4: Record Data Types
User-Defined Data Types | 243
Name __________________________________________ Date _______________________
Section _________________________________________
The exercises in this lesson use the declarations in file Distance.cpp.
Distance is defined as a record type with three fields: feet, yards, and miles. The following
three operations (functions) are defined on variables of Distance:
• ConvertFeet: Converts feet into a variable of type Distance. For example, 6002 feet is
converted to 2 feet, 240 yards, 1 mile.
•
ConvertYards: Converts yards into a variable of type Distance. For example, 5230 yards is
converted to 0 feet, ...