Ask PL-SQL Expert

In this assignment, you will implement a program to handle hotel reservations requested by customers at di erent locations connected to the Fall-OS" hotel's database.
Suppose each customer is represented by a process and the body of the process consists of all the reservations made by that customer. A customer can make reservations, payments cancellation of reservations/payments. Two or more customers may be doing the same transactions at around the same time. Obviously, reservations/payments to the same room/time period must be performed atomically (mutual exclusively). If a customer tries to reserve a room that has already been taken,then disallow this action and print a "room taken" message. If a transaction tries to operate a non-existent room, print an error message. A customer can reserve a contiguous or non-contiguous block of two or more rooms at the same time.
To ensure these concurrent operations yield correct results, you are to use Unix semaphores to control access to rooms/stay periods, which are stored in shared variables.
To simulate (1) the transmission delay between the hotel's central computer and a customer's computer, and (2) the processing of each transaction, the rst four lines in the body of each customer specify the required total execution time (in milliseconds) for each of the three operations performed at that customer. In your implementation, each speci ed time is the length of the critical section for the corresponding transaction.
Valid transactions are:
reserve (room_number) begin_date number_of_days name_of_customer
cancel (room_number) begin_date number_of_days name_of_customer
reserve (room_number1,...,room_numberK) begin_date number_of_days name_of_customer
/* non-contiguous block */
cancel (room_number1,...,room_numberK) begin_date number_of_days name_of_customer
reserve (room_number1-room_numberM) begin_date number_of_days name_of_customer
/* contiguous block */
cancel (room_number1-room_numberM) begin_date number_of_days name_of_customer
check customer_name /* show rooms and stay periods reserved */
ex{reserving a non-contiguous block of rooms:
reserve (2,5,58) ...
ex{reserving a contiguous block of rooms:
reserve (8-15) ...
You can cancel a room reservation only after you have reserved it. The input is as follows:
n /* number of rooms, numbered from 1 to n */
m /* number of customers */
customer_1:
reserve reserve_time (in milliseconds)
cancel cancel_time (in milliseconds)
check check_time (in milliseconds)
:
valid operations
:
end.
:
:
customer_m:
reserve reserve_time (in milliseconds)
cancel cancel_time (in milliseconds)
check check_time (in milliseconds)
:
valid operations
:
end.
The output after completing all transactions is: a report showing the transactions and resulting room assignments with customer names.
2


using unix C++ semaphores 

PL-SQL, Programming

  • Category:- PL-SQL
  • Reference No.:- M998657

Have any Question?


Related Questions in PL-SQL

Purpose of the assessment with ulo mapping the purpose of

Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop skills in managing data in databases and to gain understanding of data model development and implementation using a commercially a ...

For this assignment you will be provided a database backup

For this assignment, you will be provided a database backup for a database called FinanceDB. You will have to restore this backup to your own version of SQL Server. All of the questions in this assignment relate to the F ...

Continuing the project you have worked on in weeks 1-4 in

Continuing the project you have worked on in Weeks 1-4, in this final week, complete the following tasks: Refine your database and SQL statements by incorporating your instructor's feedback. Verify that the database comp ...

Complete the following tasksin microsoft access create the

Complete the following tasks: In Microsoft Access, create the database and tables that you identified in W3 Assignment 2. In Microsoft Word, write the SQL statements to create the database and tables. Write SQL statement ...

Assignment - queries functions and triggersaimthe aims of

Assignment - Queries, Functions and Triggers Aim The aims of this assignment are to: formulate SQL queries; populate an RDBMS with a real dataset, and analyse the data; design test data for testing SQL queries; create SQ ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As