The short-term, 0-24 hours, parking fee, F, at an international airport is given by the following formula: Fee = 5 if the car is parked between 0 and 3 hours inclusive Fee = 6 + int(h+1) if the car is parked more than 3 hours but less than or equal to 9 hours. Fee = 60 if the car is parked more than 9 hours but less than or equal to 24 hours where int(h + 1) is the integer value of h + 1. For example: int(3.2) is equal to 3. Write a program that prompts the user to enter the number of hours a car is parked at the airport and outputs the parking fee.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter5: Making Decisions
Section: Chapter Questions
Problem 6PE
icon
Related questions
icon
Concept explainers
Question

The short-term, 0-24 hours, parking fee, F, at an international airport is given by the following formula:

Fee = 5 if the car is parked between 0 and 3 hours inclusive

Fee = 6 + int(h+1) if the car is parked more than 3 hours but less than or equal to 9 hours.

Fee = 60 if the car is parked more than 9 hours but less than or equal to 24 hours

where int(h + 1) is the integer value of h + 1.

For example: int(3.2) is equal to 3. Write a program that prompts the user to enter the number of hours a car is parked at the airport and outputs the parking fee.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning