Question: For the problem described below write complete analysis and java code. You can write java code in online compiler and paste it in this document.

For the problem described below write complete analysis and java code.

You can write java code in online compiler and paste it in this document.

Problem Description

Java program is required to calculate total parking fees at a parking lot.

Parking lot attendant enters:

  • Number of hours
  • Vehicle type (cars at $5 per hour and heavy vehicles at $10 per hour)
  • Vehicle year (of manufacture)

The program then calculates total payment as hours * price.

Due to government regulations on carbon emission, vehicles with year of manufacture older than 1989 are charged 20% extra on the total.

Program then calculates and prints:

  • total payment
  • amount of extra payment only if added

Program terminates when 0 is entered for number of hours.

Print sensible user-friendly prompts and messages.

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!