Question: 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
- 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.
Step by Step Solution
3.32 Rating (146 Votes )
There are 3 Steps involved in it
The question is almost complete but lacks the specific details about the cars that should be added to the lists mySportsCars and myTrucks Without this ... View full answer
Get step-by-step solutions from verified subject matter experts
