C SharpCreate a class called Vehicle that will h

Question

C Sharp

  • Create a class called Vehicle that will hold a string Medium and int Wheels as public properties.
  • Create a class called Car that is derived from Vehicle and contains a Make property and a Model property.  These are both strings
  • Override the toString method for class Car.  It should print the Make and Model.
  • Create a SportCar class that is derived from Car.  Add an int NumberOfDoors property.
  • Override the toString method for SportsCar so that it prints “I am a fast moving Sports Car.”.
  • Create a Truck class that is derived from Car.  Add a decimal property called Tons and a Boolean called FourWheelDrive.
  • Override the toString method for Truck so that it prints the Make whether this truck is a 4 Wheel Drive truck.
  • Add Generic Lists of the appropriate Type called myCars, MySportsCars, and myTrucks.
  • Add the cars listed below as Sports Cars and Trucks to their respective list (mySportsCars and MyTrucks).  Do this in a method in the form named CreateVehicles called from Load.
  • Copy these books from mySportsCars and myTrucks to the myCars List.
  • Add a list box and display the Cars by iterating through the myCars list. Show the Make and Model
  • Add exception handling to the application.  Print exceptions in a list box.

 


Details
Purchase An Answer Below

Have a similar question?