Inheritance Problem 3
1. Write a Vehicle class that has a name (what kind of vehicle it is), and the number of wheels as private variables with constructor, and accessors. The toString class will have its name and number of wheels.
2. Write a Car class that extends the Vehicle class. It should also have as a private variables its cost and mpg along with constructor and accessors. Its toString class should have its name and its mpg (put in appropriate comments for what is coming out - for example Car Miles per Gallon 23)
3. Write a Bike class that extends the Vehicle class. It should also have its type (mountain, racing, or childrens). Write constructor and accessor. Its toString class should have its name and its type.
4. Write a Corvette class that extends the Car class. It should also have a boolean field that tells whether it is a convertible or not (true means it is a convertible). This field will be set when it is constructed. Write the constructor. It's toString should return Corvette and also return whether it is a convertible or not (you can use an if in the toString method).
5. Write a test class that will add 2 Cars, 3 Bikes and 3 Corvettes (1 of which is not a convertible) to an ArrayList of Vehicles. Then use a for loop to print out each Object.