Question: System.out.println ( = = = = 3 = = = = ) ;System.out.println ( = = = = 4 = = =

System.out.println("====3====");System.out.println("====4====");account1.changeLocation("Wari",5.6);account1.ridingHistory();account2.ridingHistory();account1.bookRide("Banani 11",6.8);System.out.println("====8====");account1.bookRide("Gulshan 1",2.1);System.out.printIn("You have "+
account1.remainingRides()+" ride(s) remaining.");}Jonas Kahnwald, you have visited
Merul Badda, Wari this month.
====6===
Martha Nielsen, you haven't visited
anywhere this month.
====7====
Jonas Kahnwald has booked a ride!
Destination: Banani 11
Fare: 204.0 Taka
Jonas Kahnwald, please update your
plan to premium or wait till next
month!
====8===
Jonas Kahnwald has booked a ride!
Destination: Gulshan 1
Fare: 63.0 Taka
Jonas Kahnwald, you have visited
Gulshan 1 this month.
You have 2 ride(s) remaining.You are building a ride booking app called UberApp. Using this app, a customer can book 3 rides.
- BookRide(Location, Distance) method books rides for a user and prints the fare for that ride based on the distance. After booking the ride, fare will be calculated as below:
Fare =30* distance
- A person can change the location of their last booked ride using changeLocation(Location, Distance) method. The new fare is calculated as;
Fare =30* distance +20% of new Fare. i.g. If, new Fare =210, then the total fare after changing location will be 210+210*0.2=252
- The UberApp keeps track of all the locations visited by the user in an array of String.
- The resetMonth() method resets the location visited in a month as well as the number of remaining rides of that month.
Design the UberApp class that will produce the following output.
 System.out.println("====3====");System.out.println("====4====");account1.changeLocation("Wari",5.6);account1.ridingHistory();account2.ridingHistory();account1.bookRide("Banani 11",6.8);System.out.println("====8====");account1.bookRide("Gulshan 1",2.1);System.out.printIn("You have "+ account1.remainingRides()+" ride(s) remaining.");}Jonas Kahnwald, you have

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!