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
Chapter2: Using Data
Section: Chapter Questions
Problem 13PE
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
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