|
I received feedback which led me to
realize that I wasn't totally clear on what I was expecting in Assignment
#3. The last paragraph of the assignment description reads:
Finally, write a main function which utilizes the two classes
you just wrote to test the dealership code. You should declare an
instance of a Dealership, initialize it, set an appropriate inventory
size, add cars to the inventory, print out the inventory and then
free any dynamically allocated memory. You should try to add one
more car than your maximum so that you can demonstrate that error
condition being “caught”.
From the demos in Lecture #5, this may lead you to believe that
you need to prompt the user to enter all of this information and
get the inventory size from user input as well. This is
not the case. For this assignment, there is no
user interaction! Simply declare an instance of
Dealership, initialize
it, set an arbitrary inventory size (like 5), add more vehicles
than you allocate space for (to show you are catching that), and
then call Dealership::displayInventory()
to display the inventory. That's it! Example output might look like
this:
Error: no room left in inventory DEALER INVENTORY ============================================= 1. 1984 Honda Accord : 150000 miles, PRICE: $6999.99 2. 1990 Dodge Caravan : 124001 miles, PRICE: $7999.99 3. 1994 Ford F-150 : 89934 miles, PRICE: $4999.99 4. 2003 Mercury Mountaineer : 10554 miles, PRICE: $40999 5. 2002 Kia Sportage : 24355 miles, PRICE: $5990.05 A-03 has exited with status 0.
And this would be with having called Dealership::addToInventory()
6 times after setting the inventory size at 5 vehicles.
Hope this additional information helps, please feel free to make
up your own car types, mileages and prices... Mine are probably
way off so feel free to be a little more realistic!
Again, please email me with any questions.
|