Question: Java program that must follow hte bullet points under other requirements. Instructions Your program will prompt the user for information about two weeks worth of

Java program that must follow hte bullet points under other requirements.

Java program that must follow hte bullet points under other requirements. Instructions

Instructions Your program will prompt the user for information about two weeks worth of driving for Uber and Lyft, compute the earnings for each week, and then determine which week had higher earnings. For each week, we prompt for the service that the driver drove for (Uber or Lyft), information for calculating earnings for that service, and any tips that were earned. This information is used to calculate the total earnings for each of the two weeks, the total earnings for the two week period, and an assessment of which week earned more income. Calculating Earnings For each of the two weeks, the program will ask the user which service they drove for. We will assume that the driver drives for only one service for the entirety of the week although this would probably not be true in real life Base earnings For both services, you will calculate the base pay for the week according to the formula: BASE PAY = $1.35 * MILES DRIVEN + $0.24 + MINUTES DRIVING Extra earnings Each service, however, has a different calculation for extra earnings. In the case of driving for Uber, the driver receives an additional 20% if they have accepted 95% or more of their ride requests. In the case of driving for Lyft, riders may tip and the driver receives 100% of tips. Output Printing of earnings Your program is to report the base and extra earnings and, later, the overall earnings for each week. These should be rounded to two decimal places when displayed. Hint: use printf Which week earned more? In addition to reporting the earnings for each week, the program should also produce whichever of the following messages is appropriate: . You earned more in week 1 . You earned more in week 1 . You earned the same amount both weeks Other Requirements .You should use static methods to eliminate redundant code and to break the problem up into logical subtasks. This .Your main method should be short so that a person can easily see the overall structure of the program. includes making methods that return data and methods that take data as a parameter You are to introduce at least five static methods other than main to break this problem up into smaller subtasks and you should make sure that no single method is doing too much work. In this program, none of your methods should have more than 15 lines of code in the body of the method (not counting blank lines or lines with just curly braces on them). The 15-line limitation is a special requirement for this assignment to force you to practice breaking up a program into methods

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!