Quizzes & Puzzles13 mins ago
Help to all Programmer please.. =((
4 Answers
you are going to create a more specialized Taxi Meter that contains additional information for non-air and aircon taxies. Your task is to extend the TaxiMeter class that was implemented in the previous question. Add some attributes and methods that you think are needed for a non-air and aircon Taxi records. Try to override some existing methods in the superclass TaxiMeter, if you really need to. The following describe the billing for Non-air and Aircon Taxi.
NON-AIRCON
Flag Down P 26.00
For every 400 meters P 1.00
For every 1.5 minutes waiting P 1.00
AIRCON
Flag Down P 30.00
For every 400 meters P 1.50
For every 1.0 minutes waiting P 1.50
Try to modify the TaxiMeter class to create getAmount() abstract method. This is a method for calculating the total amount to be paid. Below are the formulas:
totalAmount = amountOnWait + amountOnDistanceTravelled
amountOnWait = increments if waitingMinuteToIncrement is satisfied
amountOnDistanceTravelled = incrementRate * (distanceTRavelled /incrementableDistance)
Write two of its subclasses, the Non-air and Aircon. You can add additional methods to its subclass if you want to.
NON-AIRCON
Flag Down P 26.00
For every 400 meters P 1.00
For every 1.5 minutes waiting P 1.00
AIRCON
Flag Down P 30.00
For every 400 meters P 1.50
For every 1.0 minutes waiting P 1.50
Try to modify the TaxiMeter class to create getAmount() abstract method. This is a method for calculating the total amount to be paid. Below are the formulas:
totalAmount = amountOnWait + amountOnDistanceTravelled
amountOnWait = increments if waitingMinuteToIncrement is satisfied
amountOnDistanceTravelled = incrementRate * (distanceTRavelled /incrementableDistance)
Write two of its subclasses, the Non-air and Aircon. You can add additional methods to its subclass if you want to.
Answers
Best Answer
No best answer has yet been selected by imyna. Once a best answer has been selected, it will be shown here.
For more on marking an answer as the "Best Answer", please visit our FAQ.