Skip to content

[CODE]: Inheritance: Vehicle Management System #154

Description

@patil-rushikesh

Problem Description:
Design a Vehicle Management System with a base class Vehicle and derived classes Car and Motorcycle. The Vehicle class should hold common attributes and methods that are inherited by both Car and Motorcycle.

Location:
https://github.com/patil-rushikesh/cpp_programs/tree/main/Examples

Attributes:
Vehicle class (base class):
make (string) – The make of the vehicle.
model (string) – The model of the vehicle.
year (int) – Year of manufacture.

Car class:
seatingCapacity (int) – Number of seats in the car.
Motorcycle class:
hasSideCar (bool) – Whether the motorcycle has a sidecar or not.

Methods:
start() – A generic method in Vehicle that can be overridden in the derived classes.
stop() – A generic method for stopping a vehicle.
The program should be menu-driven, allowing the user to:

  1. Add a new vehicle (either a car or motorcycle) to the system.
  2. View vehicle details (depending on whether it is a car or motorcycle).
  3. Start/Stop a vehicle.
  4. Exit the program.

Requirements for the Issue:
Implement the Vehicle class with shared attributes and methods.
Implement the derived classes (Car and Motorcycle).
Use function overriding for methods like start() and stop().
Create a menu-driven interface allowing users to interact with the system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions