1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nadya [2.5K]
2 years ago
5

The hostel in which you plan to spend the night tonight offers very interesting rates, as long as you do not arrive too late. Ho

usekeeping finishes preparing rooms by noon, and the sooner guests arrive after noon, the less they have to pay. You are trying to build a C program that calculates your price to pay based on your arrival time. Your program will read an integer (between 0 and 12) indicating the number of hours past noon of your arrival. For example, 0 indicates a noon arrival, 1 a 1pm arrival, 12 a midnight arrival, etc. The base price is 10 dollars, and 5 dollars are added for every hour after noon. Thankfully the total is capped at 53 dollars, so you'll never have to pay more than that. Your program should print the price (an integer) you have to pay, given the input arrival time.
Computers and Technology
1 answer:
faust18 [17]2 years ago
4 0

Answer:

Answered below

Explanation:

// Python implementation

incrementAmount = 5

basePrice = 10

price = 0

arrivalHour = int(input("Enter arrival hour 0-12: ")

if arrivalHour < 0 or arrivalHour > 12:

print ("Invalid hour")

if arrivalHour == 0:

price = basePrice

else:

price = arrivalHour * incrementAmount

totalPrice = price + basePrice

if totalPrice > 53:

totalPrice = 53

print ("Your bill is $totalPrice")

You might be interested in
The _______ "represents a set of features that enables the user to inform himself whether a security feature is in operation or
quester [9]

Answer:

Visibility and configuration of security.

Explanation:

The visibility and configuration of security represents a set of features that enables the user to inform himself whether a security feature is in operation or not and whether the use and provision of services should depend on the security feature.

4 0
3 years ago
Do you think Apple will eventually meet their goal of becoming a replacement for a physical wallet
Dmitry_Shevchenko [17]
Yes they are the leading tech innovators of the 21st century and have already made massive strides in this direction
8 0
3 years ago
What is a characteristic of a wan hub-and-spoke topology?
olga nikolaevna [1]

The characteristic of the WAN hub and spoke topology is that it is considered to be a branch site or composed of the branch site in which they are likely to be connected to a site that is central and that is through the point to point links.

8 0
2 years ago
Objectives ** WILL GIVE BRAINIST PLEASE**
mamaluj [8]

Answer:

of which std this question is

8 0
2 years ago
Read 2 more answers
What does the CMYK tab let you do
Paha777 [63]

<span>CMYK means cyan, magenta, yellow, and key (black). They are the four color model used in color printing or printing color images. It lets you subtract the colors on the image. CMYK partially or fully masks colors on a lighter view. </span>

3 0
3 years ago
Read 2 more answers
Other questions:
  • How can we set the color of a text that acts as a link in a web page​
    10·2 answers
  • Variable names may contain spaces and punctuation symbols. True False
    15·1 answer
  • It proceeds the statement causes execution of the current loop iteration to end and commence at the beginning of the next loop.
    10·1 answer
  • What is the leading use of computers
    15·2 answers
  • If the list above is named list1 and is implemented as a list, whatstatement would you use to find the number ofelements?list1.s
    9·1 answer
  • Determine the “answer” to the formula according to the spreadsheet below:<br><br> =A3 + B4 + D2.
    15·1 answer
  • If you will be giving your presentation to an audience, you can practice your presentation by using View, ___________, to rehear
    14·1 answer
  • A specialized security administrator responsible for performing systems development life cycle (SDLC) activities in the developm
    11·1 answer
  • - What are the different types of clients?
    12·1 answer
  • 2.3 Code Practice: Question 1
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!