Ask coding questions

← Back to all posts
can you help me to solve 7th step of this question
harshitaceh
  1. Create a Vehicle interface.
  2. All data members should be declared as private.
  3. Make the following data members in Vehicle -
    1. int engine - Holds Engine CC
    2. int doors - Holds data for number of doors
    3. int capacity - Hold data for passenger capacity
  4. Vehicle should have some public functions as listed
  5. Public Functions -

    1. Getter/Setter for all the above data members.
    2. StartVehicle - should display "starting vehicle of type - XXXXX".
    3. StopVehicle - should display "stopping vehicle of type - XXXXX"

      (replace XXXX above with the vehicle types, see below)

  6. Create 3 classes that implement this Vehicle interface.

    1. Car
    2. Train
    3. Bike
  7. Inside main(), create an object of all 3 vehicle types using pointer of interface class and new keyword.
  8. Start/Stop all the vehicles.
  9. Show starting and stopping messages for each vehicle type correctly with the vehicle names.
Voters
harshitaceh