Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Needs to be basic javascript. Problem Statement Write a program that calculates the price of a hotel room based on the following three factors. 1.

Needs to be basic javascript. image text in transcribed

Problem Statement Write a program that calculates the price of a hotel room based on the following three factors. 1. How many will be in one room: 1-2, 3-4, or 5-6? No more than six are allowed in a room. 2. Are they members of AAA? Yes (y) or No (n) 3. What payment method do they plan to use? Check (ck) or Credit Card (cc) The program should prompt the user for all the inputs, check for invalid input, perform the calculations, and output the total cost per night. It is suggested to use at least some nested if else structures to calculate the cost. Use the .toFixed(2) method to display the total cost per night rounded to two decimal places. The rate is calculated as follows: Basic Room Rate 1-2 people = $50ight 3-4 people = $60ight 5-6 people = $70ight Discount for AAA members (off of the basic room rate) 1-2 people = 15% 3-4 people = 10% 5-6 people = 5% Payment method processing charge If they plan to pay with a check (ck), there is no additional processing charge. If they plan to pay with a credit card (cc), there is an additional 4% cost more per night after all other calculations are performed. . Error messages should occur for the following: Guest number is less than 1 or greater than 6 Guest number input is not numeric AAA membership is not a valid input (not 'y' or 'n') Users enter nothing for AAA membership Payment method is not a valid input (not 'ck or 'cc) Users enter nothing for a payment

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

Write short notes on Interviews.

Answered: 1 week ago

Question

Define induction and what are its objectives ?

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago