Question: Design a program with vehicle class as base class and two classes: car and truck derived from vehicle. The vehicle class has a method to
Design a program with vehicle class as base class and two classes: car and truck derived from vehicle. The vehicle class has a method to set the type of vehicle. The car and truck classes have two methods, one to set name and the other one to set speed. Write an OverSpeed exception class that checks the speeds of cars and trucks. The overspeed limit of cars 70 and that of truck 50. // Exception class class OverSpeed \ //Constructor to create OverSpeed s /I A method to display message // Base clas class vehicle\ public: setType(string type); private: string type l/implement setType(string type); //Derived class 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
