Write a java program : Create an abstract class ‘Fares’ with an abstract method ‘fareCharged()’. $10, $15 and $20 are the fares charged by Bus, Auto and Cab respectively. ‘Bus’, ‘Auto’ and ‘Cab’ are...


 Write a java program :


Create an abstract class ‘Fares’ with an abstract method ‘fareCharged()’. $10, $15 and $20 are the
fares charged by Bus, Auto and Cab respectively. ‘Bus’, ‘Auto’ and ‘Cab’ are subclasses of class
‘Fares’, each having a method named ‘fareCharged()’ which prints the fare charged by different
vehicles. Call this method by creating an object of each of the three classes.
Expected Output:
Fare charged by Bus is $10
Fare charged by Auto is $15
Fare charged by Cab is $20



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here