Answered step by step
Verified Expert Solution
Question
1 Approved Answer
8:35 PM Mon Feb 24 59% Not Secure - mars.umhb.edu In this project, you will write a Java program that calculates the parking fee at
8:35 PM Mon Feb 24 59% Not Secure - mars.umhb.edu In this project, you will write a Java program that calculates the parking fee at an airport parking garage, based on the following chart: Time Rate $1 $3 0 2 hours 3 4 hours 5 6 hours 7 24 hours 24+ hours $5 $10 $10 x days When calculating the parking fee, the parking time is rounded up to the next hour. For example, 50 minutes are rounded up to 1 hour; 2 hours and 30 minutes are rounded up to 3 hours; 4 hours and 1 minute go up to 5 hours; 24 hours and 30 minutes go up to 25 hours. Similarly, the parking hours larger than 24 are rounded up to the next whole day. For example, 25 hours are rounded up to 2 days; 54 hours go up to 3 days. The screenshot of the program execution looks like the following. User inputs are put into italics. Parking time in hours: 3 Parking fee: $3 Parking time in hours: 8+ Parking fee: $10 Parking time in hours: 25 Parking fee: $20 1. The program processes integer values. The user rounds up the parking time to hours and provides the number of hours to the program. The program reads just one integer number, as the parking time in hours, from the keyboard. The program displays the parking fee in dollars, which is also an integer value, on the screen. (2 points) 2. The program can handle invalid input values, i.e., negative numbers, properly. (3 points) 3. The program calculates the parking fee correctly for all cases listed in the parking rate chart above. (15 points) Submission Guidelines: 1. Put all the source-code programs into a single document, as if you would print out all the programs in a hardcopy document. The document should be in one of the following formats: TXT (recommended), MS-Word (.doc/.docx), or PDF. Incorrect file format or multiple files will cause a penalty of 50% 100% of the total points. 2. At the beginning of each program, put a short description of the function of the program (e.g., // Summing three numbers obtained from keyboard ) as comments. A penalty of 10% of the total points will be applied to missing incorrect comments
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started