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
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