Saint Louis University |
Computer Science 180
|
Dept. of Math & Computer Science |
Please see the general programming webpage for details about the programming environment for this course, guidelines for programming style, and details on electronic submission of assignments.
For this assignment, you must work individually in regard to the design and implementation of your project.
Please make sure you adhere to the policies on academic integrity in this regard.
This assignment is designed to be a bit of a puzzle. In the end, it will take relatively few lines of actual code. The key will be to successfully settle upon a those lines of code. The topic we wish to explore are the subtleties involve the life cycle of an object: how and when objects are constructed and destroyed; the distinctions between objects, references to objects, and pointer variables; the ways in which information is passed to and from functions. For preparation, we strongly suggest that you review all aspects of the object demo that we have discussed in class.
This project attempts to model the relationships between car manufacturer, car dealers, and the end customers. The manufacturers produce cars and in some cases provide support to dealers for properly servicing cars. The dealers act as intermediaries between the manufacturers and the customers. The customer is the end client and interacts only with the car dealer (never with the manufacturer).
There are three main components to this project: the Car class, the Dealer class, and a Customer application.
orderCar
This function is what the public will use when they want
to purchase a car. It should take two parameters,
specifying the desired color and the desired number of
doors.
repairCar
This function should take one parameter which is used to
specify the particular car in question. The dealer will
be responsible for seeing that the car is fixed. However,
dealers are only willing to repair cars that were
purchased at their dealership. A call to this function
on any other car should leave it in a broken state.
You may notice that we have been intentionally vague as to the precise signature of these two methods. It is up to you to decide upon the precise means to accomplish the desired goals. In fact this is the biggest challenge in the assignment.
The files you need for this assignment can be
downloaded here or copied directly on turing as
Please see details regarding the submission process from the general programming web page, as well as a discussion of the late policy.
You should submit four files:
Customer.cpp - The file which includes the main routine.
Dealer.h - The revised definition of a Dealer class.
Dealer.cpp - The revised implementation of Dealer functions.
readme - In your own words, please explain what decisions led you to the final choice of signatures for the orderCar and repairCar functions. You may add any further comments you wish to make to the grader.
Notice that you need not submit the Car class files or the makefile, as they are presumed to be unchanged from those we originally provided.