CS 1401, Quiz #8

Date: Tuesday, March 8, 2005
Name (please type legibly, ideally in block letters): ______________________________________________________________________

1. Sports writers and newscasters in El Paso want to produce a special feature highlighting the successful season of all UTEP sports teams.  To help them analyze statistics, write a code segment that reads in any number of integer scores from a file scores.txt, sums them, and finds the average score.

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

2. Describe the three basic steps in developing an object-oriented design using CRC cards.

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

3. As part of designing an object-oriented software project to simulate road traffic, the classes identified are follows:

 

       PickupTruck       Sedan      Motorcycle      Car       Vehicle       Truck       Minivan      DeliveryTruck

 

             

    (a). Draw an inheritance diagram that shows the relationship between these classes.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

    (b). Construct a CRC card for class Car.   Include the appropriate labels in each part of the card.