52.6k views
1 vote
Aaron is staying at a hotel that charges $100 per night plus tax for a room. A tax of 8% is applied to the room rate per day and an additional one-time fee of $5.00 is charged by the hotel. Which of the following represents total charge, in dollars, for staying x nights?

(100 + .08*x) + 5
1.08(100*x) + 5 correct answer
1.08(100*x + 5)
1.08(100 + 5)* x
Template for your consideration

T = .08 # tax for each day
F = 5.00 # one time fee
R = 100 # room rate
d = int(input("Enter the number of days stayed at the hotel "))
c = 0 # initialize cost variable
if (d > 0): # days > 0
# calculations here to compute the solution
# remember to use constants T R and F in your calculations
# use the correct answer provided
print(" the cost for ", d, " days is ", c )
else: # here m is <= 300 # s <= 0
print(" Invalid entry for days ", d )

1 Answer

7 votes

Answer:

We use the Python language to implement the code, if you have and IDE, simply copy and paste the code and run it

Note: the cost function is c=(R+ .08*d)+5

Step-by-step explanation:

#initialize some variables

T = 0.08 # tax for each day

F = 5.00 # one time fee

R = 100 # room rate

d = int(input("Enter the number of days stayed at the hotel "))

c = 0 # initialize cost variable

if (d > 0):

c=(R+ .08*d)+5

print(" the cost for ", d, " days is ", c )

else:

print(" Invalid entry for days ", d )

User H W
by
6.6k points