Question: That will be a JS file which will be a separate file from HTML., not console or inline Need some help to complete JS undefined

That will be a JS file which will be a separate file from HTML., not console or inline

That will be a JS file which will be a separate filefrom HTML., not console or inline Need some help to complete JSundefined Your task is to create a Hotel class (using E56). TheNeed some help to complete JS

properties of this hotel are: name (string) - the name of theundefined

Your task is to create a Hotel class (using E56). The properties of this hotel are: name (string) - the name of the hotel(for example, "Marriott) rooms (number) - number of rooms in the hotel (for example, 40) booked (number) - number of rooms that have been booked (for example, 25) gym (Boolean) - does the hotel have a gym? (for example, true) roomTypes (array) - what types of rooms (for example, "twin", "double", "suite") location (string) - for example, "Vancouver" swimmingpool (boolean) - true or false airportShuttle (boolean) - true or false restaurants (map) - should contain a map that has the restaurant name and restaurant type with three restaurants and the type of food they serve. For example: Harolds - American, Kyoto - Japanese, Relax - Fusion. . For this lab assignment, using ES6, you must create the Hotel class. You must create a constructor that sets the following 5 properties: 1. Name 2. City 3. Rooms 4. Booked 5. Gym Once you have created an instance of the Hotel Class (called hotel), you can add the rest of the values for the remaining properties. To help you out: To create the map (as part of your hotel object): restaurants: [["Harolds", "American"], ["Kyoto", "Japanese"], ["Relax", "Fusion"]] To display the map: for (let [key, value] of hotel.restaurants) { // YOUR CODE HERE } Additional Methods: Please create the following code add "getter" and "setter" methods for the 5 constructor properties. bookRoom() - this method should add 1 to the booked property and display a message that the room was booked and that there are x rooms remaining for booking cancelRoom () - this method should remove 1 from the booked property and display a message that the room was cancelled and that there are x rooms remaining for booking. Write JavaScript code to demonstrate the functionality of all of the properties and methods for your new object. You must implement the following tests: Display the hotel name and location Display how many rooms are available Book a room, show how many rooms are available Cancel a room, show how many rooms are available Add a room type (honeymoon), display the room types now available Display whether the hotel has a pool (true or false) Display all of the restaurants name and theme) that are at the hotel An example display showing functionality through testing is shown in Figure 1. The hotel is a Marriott, located in Richmond There are 15 rooms available today You have booked a room. There are now 14 rooms available today. You have cancelled your room. There are now 15 rooms available today The available room types are: twin,double, suite, Honeymoon Hotel has a shuttle? false Hotel has a swimming pool? true Hotel has 3 restaurants each with a different theme. They are: Harolds: American Kyoto: Japanese Relax: Fusion Figure 1. Testing the functionality of the hotel object. Create a new class called Resort that inherits from the Hotel Class. Resort has two new properties: resortType (string) - what type of resort is it? (for example "singles", "family") beachfront (boolean) - is the resort on the beach? kidsclub (boolean) - does the resort have a kids club? Create a constructor for this new class that initializes the three new properties. Create getter and setter functionality for the new class. Test the class by performing the following steps shown in Figure 2. Part 2 A new Resort has been created: Renaissance Phuket located in Phuket. It is a family resort Is it on the beach? true Does it have a kids club? true Oh No! The kids club is being renovated! Does it have a kids club? false Figure 2. Testing the newly created class Resort that extends the Hotel Class

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!