Write a class for vehicle, inherit classes named as car, bike, and any one of (rikshaw, boat,
Question:
Write a class for vehicle, inherit classes named as car, bike, and any one of (rikshaw, boat, ship and plane) from it. Further inherit classes named as door, wheel, engine, window, trunk, windshield wiper, petrol tank, wings, anchor, steering wheel and any other that you can think of. Create multiple objects from them and perform different functions including following.
Car:, , ,Window,Trunck,Windsheild,Wiper,SteeringWheel,PetrolTank
Bike: PetrolTank,EngineOn,EngineOff
- Engine on/off()
- Windows slider up/down()
- Turn right/left/stop/reverse() à Wheel moveforward/reverse() [Think of the logic yourself]
- Clean windscreen()
- Tank full or not(), Open tank lid(), petrol quantity(), Reserve()
- Drop anchor(), Lift anchor()
- Rotate plane left/right()
Make your own logic as explained in lab, there are multiple solutions to this problem, and they are all acceptable. Do not copy from others. Every function should display it’s working as explained in lab.
Create the UML diagram of your class. Mention class, functions, and variable names in it.
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last