Question: STRUCT The STRUCT that defines a room A single room in a hotel is represented as: HotelSuite STRUCT ; defines HotelSuite Structure roomNum dword ?

STRUCT
The STRUCT that defines a room
A single room in a hotel is represented as:
HotelSuite STRUCT ; defines HotelSuite Structure
roomNum dword ? ; will be initialized in proc initRoomNums
roomType byte 'S' ; default to S for Standard
available byte 1 ; default to 1 for available
nights dword 0
rate dword 30 ; default to 30 for standard
HotelSuite ENDS
For the available field, the value 1 means available and 0 means unavailable (a.k.a. occupied)
For the nights field, the value will be initialized to 1 when a room is booked. When the 'night' process
runs, all occupied rooms have the nights field incremented
Declaration and Initializing of Array of STRUCT
For this Hotel, each floor has the same number of rooms. The rooms numbered 1(101,201, etc) have a
nicer view and therefore cost more (150). The top floor has the best views and so there is a premium of
+100 for the top floor. Room 1 on the top floor is a double premium 250. The last room on each floor is
a tiny room that is an Economy room and costs less than others, 19, except the Economy on the top
floor which is 119
This is a snippet from a run using 5 floors and 3 rooms per floor:
Displaying the Array
Display the hotel from "the top down", where the top floor is displayed first and the bottom floor is
displayed last. (see prior page)
Interacting with the user
You need a sentinel-controlled loop that interacts with the user (get and process the command)
The commands will be B, C, N, and X (lower case too)
The Commands:
B - Book a Room
After getting the room number from the user (see below) you should:
for available rooms: mark as unavailable and set nights to 1.
For occupied rooms: display a message saying it can't be booked ( see sample runs)
C- Checkout a Room
After getting the room number from the user (see below), you should:
for occupied rooms: mark as available and calculate the bill as the room's rate * the # of nights.
For unoccupied rooms: display a message saying it can't be checked out (see sample runs)
N - Next Day
For all occupied rooms, increment the nights by 1. For this command you can use a simple loop to visit
all rooms in the "Array"
Getting the room number from the user
Use a readDec to get the room number from the user. You need to translate that room number into the
correct row/col in the table. For this project you can assume the room number is a valid int. BUT, you
need to handle an array that is 12 xx12, so don't just pull off the first and last digits.
HINT: if you divide the room number entered by 100, EAX will have the quotient (floor) and EDX will have
the remainder (room).
Im suppose to do this in assembly but having difficulty doing this.
Also suppose to use this: HotelSuite STRUCT ; defines HotelSuite Structure
roomNum dword ? ; will be initialized in a procedure to
inititialze roomNum, roomtype, and rate
roomType byte 'S' ; default to S for Standard
available byte 1 ; default to 1 for available
nights dword 0
rate dword 30 ; default to 30 for standard
HotelSuite ENDS
; (insert symbol definitions here)
NUM_FLOORS =5 ; constant for number of floors
ROOMS_PER_FLOOR =6 ; constant for number of rooms per floor
ROOM_FREE =1
ROOM_OCCUPIED =0
.data
; (insert variables here - flush left)
arrayOfHotelSuite HotelSuite NUM_FLOORS * ROOMS_PER_FLOOR dup(>) ;
creates 2-d array Sample Run
Hotel California
Enter Command (B, C,N,X): f
Invalid Command STRUCT
The STRUCT that defines a room
A single room in a hotel is represented as:
```
HotelSuite STRUCT ; defines HotelSuite Structure
roomNum dword ? ; will be initialized in proc initRoomNums
roomType byte 'S' ; default to S for Standard
available byte 1 ; default to 1 for available
nights dword 0
rate dword 30 ; default to 30 for standard
HotelSuite ENDS
```
For the available field, the value 1 means available and 0 means unavailable (a.k.a. occupied)
For the nights field, the value will be initialized to 1 when a room is booked. When the 'night' process runs, all occupied rooms have the nights field incremented Sample Run
Hotel California
Enter Command (B, C,N,X): f
Invalid Command Declaration and Initializing of Array of STRUCT
For this Hotel, each floor has the same number of rooms. The rooms numbered \(1(101,201\), etc) have a nicer view and therefore cost more (150). The top floor has the best views and so there is a premium of +100 for the top floor. Room 1 on the top floor is a double premium 250. The last room on each floor is a tiny room that is an Economy room and costs less than others, 19, except the Economy on the top floor which is 119
This is a snippet from a run using 5 floors and 3 rooms per floor:
STRUCT The STRUCT that defines a room A single

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 Programming Questions!