Question: QUESTION 41 Write a Java program called TaxiCalculator which will calculate and display taxi ride depending on the distante (km) and number of passengers (passengers)
QUESTION 41 Write a Java program called TaxiCalculator which will calculate and display taxi ride depending on the distante (km) and number of passengers (passengers) The program should calculate the price using a retura method and display it using void method. The program should do the following tasks: a. Declare a method fillData to fill in the variable's km and passengers. To call this method, you need to send an appropriate message parameter like "Enter the distance in Kilometer(Km)" or "Enter the number of passengers". (2 marks) b. Write a method called calculate Price which takes the distance and the number of passengers as input parameters, then calculates the price using the following formula price km passnegers (2 marks) in minthad dirnu Prirth dirnur the nine (1 mark
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
