
Lesson 10-5: Hierarchical Records
User-Defined Data Types | 245
Name __________________________________________ Date _______________________
Section _________________________________________
This lesson works with program Cars defined in the Prelab assignment.
Exercise 1: Augment Car in program Cars with the following two members:
sold A Boolean variable
soldDate If (sold), then soldDate contains the date of sale;
otherwise, soldDate is undefined.
Function GetCar should initialize sold to false. Write a function CarSold that takes variables
of type Date and Car and records that the car has been sold and the date. Before invoking
PrintCar, write the car ...