The document outlines an assignment involving object-oriented programming concepts such as abstraction and polymorphism. It requires the creation of a base class 'Vehicle' with various attributes and methods, along with two derived classes 'Truck' and 'Bus' that inherit from 'Vehicle' and implement their own specific attributes and overridden display methods. Each class must include parameterized constructors, getters, and setters for their respective attributes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views
Assignment 8
The document outlines an assignment involving object-oriented programming concepts such as abstraction and polymorphism. It requires the creation of a base class 'Vehicle' with various attributes and methods, along with two derived classes 'Truck' and 'Bus' that inherit from 'Vehicle' and implement their own specific attributes and overridden display methods. Each class must include parameterized constructors, getters, and setters for their respective attributes.
method that will display all the information of a vehicle.
B - Create Class Truck which will inherit from Vehicle:
• Data Member: Cargo weight limit (Kilo grams). • Parameterized constructor. • Setter and getter. • A display() method which will override parent method and print all info.
C - Create Class Bus which will inherit from Vehicle:
• Data member: Num of passengers int. • Parameterized constructor. • Setter and getter. • A display() method which will override parent method and print all info.