Question: Write in Java 1. (9 pts) As indicated at http://www.flymemphis.com/parking,_Memphis International Airport uses the following pricing schedule for their short-term parking fees: Time First 30

Write in Java
 Write in Java 1. (9 pts) As indicated at http://www.flymemphis.com/parking,_Memphis International

1. (9 pts) As indicated at http://www.flymemphis.com/parking,_Memphis International Airport uses the following pricing schedule for their short-term parking fees: Time First 30 minutes 31 to 60 minutes Each additional 30 minutes 24-hour maximum Pricing FREE $2.00 $1.00 $24.00 Within your Lab7 folder, create a new file named AirportParking.java. Write a method public static int parkingCharge(int minutes) that takes a parameter for the number of minutes parked and returns the appropriate short-term parking charge, in dollars. Assume that the airport will always round UP to the next half-hour- for example, parking exactly 60 minutes would cost $2, but 61 minutes would make it $3. After all, they want to make as much money as possible! If the method is called with a zero or negative argument, make it return zero. If the method is called with an argument exceeding 24 hours, the 24-hour maximum charge should be applied to each complete day, and any partial day should be charged according to the schedule in the table. For example, parking for 1471 minutes would result in a charge of $26. The first 1440 minutes (24 hours) costs $24, the next 30 minutes is free, and the next 1 minute costs $2. Hint: Start by determining three things -1) how long it takes to reach the 24-hour maximum charge (it is NOT 24 hours), 2) how many full days are contained in the argument, and 3) how many 30-minute increments are contained in the partial day that's left over

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!