hour: 3.00 pounds • 2-4 hours: 4.00 pounds • 5-6 hours: 4.50 pounds • 7-8 hours: 5.50 pounds Next modify the resulting charge based on whether they are local or not: • If local: subtract 1 pound
Write a JAVA procedural program (procedural
park in a tourist town. If they say they are disabled, they are told it is free. Otherwise they enter the number
of hours as a whole number (1-8) that they wish to park as well as whether they have an “I live locally”
badge or are an old age pensioner both of which leads to a discount. The program tells them the cost to park.
The calculation is done in this program as follows. If they are disabled it is free. Otherwise … Take number
of hours they wish to park and give a basic charge:
• 1 hour: 3.00 pounds
• 2-4 hours: 4.00 pounds
• 5-6 hours: 4.50 pounds
• 7-8 hours: 5.50 pounds
Next modify the resulting charge based on whether they are local or not:
• If local: subtract 1 pound
• If OAP: subtract 2 pounds
Your program MUST include methods including ones that
- asks for the hours and returns the basic charge.
- asks whether they live locally / are an OAP and returns the amount to subtract.
- provide commented code with explanation in every step
THE PROGRAM MUST:
- use if-then-else statements.
- be split in to methods and includes methods that return a result
- use indentation in a way that makes its structure clear.
![An example run of the program (words in bold are typed by the user: pop-up boxes may be used for I/O):
Are you disabled? Yes
Parking for you is free
Another example run:
Are you disabled? No
How many hours do you wish to park
Do you have an "I live locally badge"? Yes
Are you an OAP? Yes
The parking charge for you is 1.50 pounds.
Another example run:
(1-8)? 5
Are you disabled? No
How many hours do you wish to park
Do you have an "I live locally badge"? Yes
Are you an OAP? No
The parking charge for you is 2 pounds.
(1-8)? 1](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fa959c3e2-24d7-4bac-89a8-7a621a28f6f4%2Fe75f5cd1-8f40-47e4-a92b-ad76d443d7f4%2Fjraq4l6_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)