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 function takes two string parameters; the first is the name of a file and the second is text. Complete the function to appen
castortr0y [4]

Answer:

The code for the function is given below in Python language

Explanation:

def append_string_to_file(filename, text):// function takes the filename // and text  to append

f = open(filename, 'a')

f.write(text) //function part that writes the text

f.close() //closing the file using the explicit close function

3 0
3 years ago
What is the purpose of citations?
Elina [12.6K]

Answer: Citiations areto show where you got information from.

Explanation:

6 0
3 years ago
Select the most likely outcome of making only on-time minimum payments to a credit
Serjik [45]
The answer is B. Your will have gone mostly towards paying interest and you will still owe the majority of the balance that you had from ago
4 0
3 years ago
What is computer system ?​
Over [174]

Answer:

a system that is a computer

6 0
3 years ago
Read 2 more answers
What's the difference between natural systems and man made systems <br>​
Aneli [31]

Answer:

Natural systems are already in place while man made systems were created by humans manipulating things in some way.

Explanation:

man made: human created

natural systems: existed without interference

5 0
2 years ago
Other questions:
  • The main thing that adjusting the aperture controls when taking an image is?
    15·1 answer
  • Any software or program that comes in many forms and is designed to disrupt the normal operation of a computer by allowing an un
    13·1 answer
  • Which of the following is a reason why the comments tool within PDF documents could be helpful? (Select all that apply.)
    5·1 answer
  • Which of the following actions might contribute to recommendations you see online?
    6·1 answer
  • When you make taffy (a pliable candy), you must heat the candy mixture to 270 degrees Fahrenheit.
    8·1 answer
  • Which would you trade on a stock exchange? A: Shares B: Bonds C: Annuities
    6·2 answers
  • __________ is a growing practice in cooperative farmingassociations to pool and sell the fruit as a common commodity underthe br
    6·1 answer
  • Question 1 (1 point)
    9·1 answer
  • Help asap !!!<br>which component of cpu controls the overall operation of computer..​
    9·1 answer
  • Rachelle is writing a program that needs to calculate the cube root of a number. She is not sure how to write the code for that
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!