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 ; default to for available
nights dword
rate dword ; default to for standard
HotelSuite ENDS
For the available field, the value means available and means unavailable aka occupied
For the nights field, the value will be initialized to 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 etc have a
nicer view and therefore cost more The top floor has the best views and so there is a premium of
for the top floor. Room on the top floor is a double premium The last room on each floor is
a tiny room that is an Economy room and costs less than others, except the Economy on the top
floor which is
This is a snippet from a run using floors and 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 sentinelcontrolled 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
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 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 rowcol 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 xx so don't just pull off the first and last digits.
HINT: if you divide the room number entered by 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 ; default to for available
nights dword
rate dword ; default to for standard
HotelSuite ENDS
; insert symbol definitions here
NUMFLOORS ; constant for number of floors
ROOMSPERFLOOR ; constant for number of rooms per floor
ROOMFREE
ROOMOCCUPIED
data
; insert variables here flush left
arrayOfHotelSuite HotelSuite NUMFLOORS ROOMSPERFLOOR dup ;
creates d array Sample Run
Hotel California
Enter Command B CNX: 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 ; default to for available
nights dword
rate dword ; default to for standard
HotelSuite ENDS
For the available field, the value means available and means unavailable aka occupied
For the nights field, the value will be initialized to 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 CNX: f
Invalid Command Declaration and Initializing of Array of STRUCT
For this Hotel, each floor has the same number of rooms. The rooms numbered etc have a nicer view and therefore cost more The top floor has the best views and so there is a premium of for the top floor. Room on the top floor is a double premium The last room on each floor is a tiny room that is an Economy room and costs less than others, except the Economy on the top floor which is
This is a snippet from a run using floors and rooms per floor:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
