Question
Hello! I would greatly appreciate help with this! Write a MIPS assembly language program that reads in how many days a customer will be staying
Hello! I would greatly appreciate help with this!
Write a MIPS assembly language program that reads in how many days a customer will be staying in a hotel, and also reads in how many number of beds per room were needed, compute its price based on the following rules:
If a customer is staying in a room with one bed for less than 8 days, then the total price will be $90 * the number of days to stay.
If a customer is staying in a room with one bed for 8 days or more, then they will get the discount of $60, and the total price will be $90 * the number of days to stay - $60.
If a customer is staying in a room with two beds for less than 8 days, then the total price will be $150 * the number of days to stay.
If a customer is staying in a room with two beds for 8 days or more, then they will get the discount of $90, and the total price will be $150 * the number of days to stay - $90.
For any other case, the price should be $0.
If a customer enters a number of beds per room to be any number other than 1 or 2, then it should print out the message "Sorry, we have only one or two beds per room. ", and exit the program without computing its price. If a customer enters 1 or 2 as a number of beds per room, then the program should proceed to compute its total price, and print out the message using the format of "Your total price: XXX dollars for YYY days ". where XXX is the total price and YYY is the number of days to stay.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started