
Patrick B. answered 02/23/21
Math and computer tutor/teacher
numRooms = input(" How many rooms :>")
numNights = input(" How many Nights :>")
priceRate = input(" Input the price rate :>")
salesTax = input(" Input the sales tax percent wihtout percent sign Ex. 7 or 6.5 :>")
P = int(numRooms) *int(numNights) * float(priceRate)
grossCost = P
discountPercent = 0
if (int(numRooms)>=30):
discountPercent=30
elif (int(numRooms)>=20):
discountPercent=20
elif (int(numRooms)>=10):
discountPercent=10
if (int(numNights)>=3):
discountPercent = float(discountPercent)+5
discountAmount = float(P) * float(discountPercent)/100.000
discountCost = float(P) - float(discountAmount)
taxAmount = float(discountCost)*float(salesTax)/100.00
finalCost = float(discountCost) + float(taxAmount)
print(" # of rooms: " + str(numRooms))
print(" # of night: " + str(numNights))
print(" price rate = $" + format(float(priceRate), ".2f"))
print(" sales tax = " + str(salesTax) + "%")
print(" gross cost = $" + format(float(grossCost), ".2f"))
print(" discount percent = " + str(discountPercent) +"%")
print(" discount amount = $" + format(float(discountAmount), ".2f"))
print(" after discount = $" + format(float(discountCost), ".2f"))
print(" tax amount $" + format(float(taxAmount), ".2f"))
print(" final cost = $" + format(float(finalCost), ".2f"))