CSD201_-_PE_-_03_3199.webp
fresh_air

CSD201_-_PE_-_03_3199.webp

Bài viết gốc: Chủ đề 'CSD201 - PE - 03'
Troubleshooting:
If the given project (e.g. Q1) runs with error, you need to run "Clean and Build Project" (Shift+F11). If still error, try to rename or copy the project to other one, e.g. from Q1 to Q1X or Q1Y.
Questions: (10 marks)
The given files already contain statements to implement a program for managing a Hotel. The structure of the main classes:
Class Room: contains information about a Room object, including:
o code (001, 002, 003, ...)
o status: is 0 (if the Room is empty/available), or 1 (if there is/are customer(s) in the Room)
O size (must be > 0): the maximum number of people renting/using this Room
O price (must be > 0)
Class Node: includes info (a Room object) and next (a pointer for linking).
Class dataList: is a singly linked list that manages regular Nodes with complete information. This class plays the role of managing all Room in the Hotel.
Class requestQueue: is a queue structure (implemented as a linked list), where the component info of the Nodes contains only size (the number of people renting the Room)and price (the expected price, or the maximum money the the customer(s) can pay). Note:size>0 and price>0.
1
Class Hotel: is the main class of the program, containing a dataList used to manage the Room objects and a requestQueue corresponding to a queue of order.
Students are required to carefully read the provided code segments to fully understand the relationships between the classes and the functions within each class. The specific task of the test is to execute the following requirements:
a. fl(): 2.5 marks - Load data
To complete the requirement f1(), students need to fulfill two specific tasks: implement the function addLast() in the dataList class and the function enQueue() (similar to addLast)in the requestQueue class.
The expected output used to test your code are as follows:
Data List: (001,0,10,200) (003,0,3,70) (004,0,4,100) (005,0,3,70) (VIP,0,10,80)
Request (1,100) (12,500) (4,50) (4,400)
. f2(): 2.5 marks - Serve the first request in the requestQueue b
To complete the requirement f2(), students need to perform three specific tasks: (1)

+ 100%
Zoom
Close
Chưa có bình luận nào.

Thông tin

Category
CSD201
Thêm bởi
fresh_air
Ngày thêm
Lượt xem
6,353
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
CSD201_-_PE_-_03_3199.webp
File size
525.1 KB
Dimensions
2560px x 1494px

Share this media

Back
Bên trên Bottom