Question: For this assignment, you will write a program to compute the cost to stay at the Krusty Towers. We will be using if else statements

 For this assignment, you will write a program to compute the
cost to stay at the Krusty Towers. We will be using if

For this assignment, you will write a program to compute the cost to stay at the Krusty Towers. We will be using if else statements to determine if there will be any discounts and of course you'll be using the iomanip library to format your output nicely. You will use setu manipulator to column the output and you will need to output the decimals to two decimal places. Using the same logic from the last assignment, you will create a menu that will continyously akk for more input until the user decides to quit, also now if an input error occurs you will re-prompt, the details can be seen in the next section. Implementation details You will perform the following steps: 1. Prompt the user to enter the cost per room and then read in the value which will be a cecimal. 2. If an input error occurs, the value entered is less than 1 , or the value entered is greater than 199.99 in step [, output the error and go back to stepli. 3. Prompt the user to enter number of rooms to book and then read in the value which will be an integer. 4. If an input error occurs, the value entered is less than 1 , or the value entered is greater than 300 in step [3, output the error and go back to step [. 5. Prompt the user to enter number of days they will stay at the hotel and read in the value which will be an integer. 6. If an input error occurs, the value entered is less than 1 , or the value entered is greater than 90 in step [5, output the error and go back to step [S. 7. Calculate the total cost before discounts, total discounts, cost after discounts, taxes to be paid, and the final cost after, discounts are deducted and taxes are added. 8. Output the values calculated in step [ all formatted nicely, look at the sample output. 9. Prompt the user and ask whether the user wants to continue or quit (read in as a single character). If the user enters c or C then continue to the next step, if the user enters q or Q then terminate the program 10. Go back to step 1 As for the logic, if the number of days the user stays books at least 10 rooms, you will deduct 10% from the total, if the user books at least 20 rooms then dedust 20% from the total, and if the user books at least 30 rooms then deduct 30% from the total. In addition if the user stays for at least 3 days at the hotel, deduct another 5% from the total (from the raw total). Requirements You will once again need to declare appropriate variables with names that have meaning. You will need several named constants for the discount rates from the previous section (so when you take 10/20/30\% off because of the discount, use a constant that contains that value for computation not the literal). You will also need a constant for the sales tax which will be 8.15%. Lastly you will need constants to hold the minimimum/maximum values for the room price/amount of rooms/amount of days. As always you need to document your code as well as all of your variables and constants

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!