C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 4, Problem 14PE

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

F = { 5 , if 0 h 3 6 × int ( h + 1 ) , if 3 < h 9 60 , if 9 < h 24

Where int (h + 1) is the integer value of h + 1. For example, int (3.2) = 3, int (4.8) = 4. 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.

Blurred answer
Students have asked these similar questions
Dinah Shore of Shore We Can Building is attempting to determine the cost forbuilding a custom lumber dog house. Each dog house starts at a cost of $1000. Eachhouse has a different possible size in square feet, which the user will enter. The sizein square feet must be in the range of 1200-2000 inclusive. However, since each doghouse is made from found wood, the actual size of the dog house varies depending onthe materials they have on hand. Once the size has been entered, create a randomnumber to determine the actual size the house will be. This size number should be inthe range of 800 to 2200. If the actual size of the dog house is over the squarefootage the user entered, they only get charged $3 per square foot. If the actual sizeis equal to or under the square footage entered they get charged $4 per squarefoot. The program should calculate the total cost for the dog house. The output forthis program must include the customer’s name, entered size, actual size and totalcost, in that…
In coral language please A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400 Some example leap years are 1600, 1712, and 2016. Write a coral program that takes in a year and determines whether that year is a leap year. If the input is 1712, the output is: 1712 is a leap year. If the input is 1913, the output is: 1913 is not a leap year.
A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400 Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines whether that year is a leap year. Ex: If the input is: 1712 output: 1712 is a leap year.  input: 1913 output: 1913 is not a leap year. My Code: def is_leap_year(user_year):if((user_year % 4 == 0 and user_year % 100 != 0) or (user_year % 400 == 0)):print("{} is a leap year.".format(user_year))else:print("{} is not a leap year.".format(user_year))return is_leap_year if __name__ == '__main__':user_year =…
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY