Final answer:
To solve this problem, we need to create three classes: Vehicle, Car, and Jeep, with specific attributes and a getFare() function. Inheritance can be used to reduce code duplication.
Step-by-step explanation:
To solve this problem, we need to create three classes: Vehicle, Car, and Jeep. All of these classes will have attributes such as manufacturer, mileage, capacity to fit people, and fare. The basic fare for all vehicles is PKR 100 for each seat. In addition to the basic fare, cars cost 10% more, while jeeps cost 20% more. To reduce code duplication, we can use inheritance. The Vehicle class will have a function called getFare() that will return the fare of a vehicle.