Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

  1. Create a class called Vehicle that will hold a string Medium and int Wheels as public properties.
  2. Create a class called Car that is derived from Vehicle and contains a Make property and a Model property.These are both strings
  3. Override the toString method for class Car.It should print the Make and Model.
  4. Create a SportCar class that is derived from Car.Add an int NumberOfDoors property.
  5. Override the toString method for SportsCar so that it prints “I am a fast moving Sports Car.”.
  6. Create a Truck class that is derived from Car.Add a decimal property called Tons and a Boolean called FourWheelDrive.
  7. Override the toString method for Truck so that it prints the Make whether this truck is a 4 Wheel Drive truck.
  8. Add Generic Lists of the appropriate Type called myCars, MySportsCars, and myTrucks.
  9. 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.
  10. Copy these books from mySportsCars and myTrucks to the myCars List.
  11. Add a list box and display the Cars by iterating through the myCars list. Show the Make and Model
  12. 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

Step: 1

Use the following link to download the entire solution httpsdrivegoogl... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java Programming

Authors: Joyce Farrell

9th edition

1337397075, 978-1337397070

More Books

Students also viewed these Programming questions

Question

Present main arguments for and against the computer metaphor.

Answered: 1 week ago