Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Theory Icdt 99 7th International Conference Jerusalem Israel January 10 12 1999 Proceedings Lncs 1540

Authors: Catriel Beeri ,Peter Buneman

1st Edition

3540654526, 978-3540654520

More Books

Students also viewed these Databases questions