Question

This assignment is similar to the Hotel exercise you did in class. Single Room (1 Double...

This assignment is similar to the Hotel exercise you did in class.

  1. Single Room (1 Double Bed): $59.99
  2. Double Room (2 Double Beds): $79.99
  3. Single Queen Room (1 Queen Bed): $89.99
  4. Double Queen Room (2 Queen Beds): $99.99
  5. Single King Room (1 King Bed): $110.99
  6. Double King Room (2 King Beds): $139.99

Additionally, for the Double King Room, the user can request a sofa-couch, which will be an additional $10.00. The memberships are the same.

Write a program to incorporate these changes. You may write the program from scratch (recommended) this is also fine given that programmers tend to do this often, but as you are now learning, I would highly recommend that you do everything from the very beginning.

Please write the code in Python.

Homework Answers

Answer #1

Please find the code in pyhton. Please let me know if I need to use any other format.

room_type = input("Select room type: ").lower()
if (room_type == 'double king room'):
sofa_req = input("Do you need sofa couch? (yes/no): ")
if (sofa_req == 'yes'):
additional_price = 10
else:   
additional_price = 0
total_price = ''
if(room_type == 'single room'):
total_price = '$59.99'
elif(room_type == 'double room'):
total_price = '$79.99'
elif(room_type == 'single queen room'):
total_price = '$89.99'
elif(room_type == 'double queen room'):
total_price = '$99.99'
elif(room_type == 'single king room'):
total_price = '$110.99'
elif(room_type == 'double king room'):
total_price = '$' + str(139.99+additional_price)
print("Total Price: ", total_price)
  

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT