Working the fleet
Leveling assignment for Object Oriented design

This programming assignment is different from the others:

  • You will have 30 minutes in class to work on it
  • The objective is a baseline assessment of what you learned in Cosi 12 or Cosi 21
NOTE You can use any programming language or do it in pseudo code. Get as far as you can. Partial work will get credit.
  • We want to represent a rental car fleet, with many different kinds of vehicles:
    • Passenger cars, defined by color and make
    • Trucks, defined by color, make, and capacity
    • Electric Cars, defined color, make, and range in miles
    • The fleet itself, containing some number of each of those vehicles
  • Define a class structure for each of those. You may use inheritance if you want.
    • The fleet class should include methods as follows
      • Constructor
      • Add vehicle
      • Delete vehicle
      • Count total vehicles
      • Find vehicles
  • Write a main program that
    • Creates a fleet with 2 cars, one truck and one electric
    • Adds an additional electric car to the fleet
    • Deletes that electric car again
    • Prints out a report showing how many vehicles of each kind exist in the fleet