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 ‘fareCha

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

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

PLEASE HELP ME WITH THIS PROGRAM IN JAVA

]

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning