0% found this document useful (0 votes)
108 views

Java Project

The document describes a simple airline ticket reservation system that uses RPC or RMI. It includes: 1) A reservation server (rsvserver) that maintains seat availability information for a single flight with 30 total seats, including 5 business class seats and 25 economy seats. 2) A reservation client (rsvclient) that interacts with users to send requests like listing available seats, reserving seats, and listing booked passengers. 3) The client can make requests to the server like reserving seats if available, checking availability, and listing current reservations. The server responds with the updated status and availability.

Uploaded by

Sohaib Choudhary
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views

Java Project

The document describes a simple airline ticket reservation system that uses RPC or RMI. It includes: 1) A reservation server (rsvserver) that maintains seat availability information for a single flight with 30 total seats, including 5 business class seats and 25 economy seats. 2) A reservation client (rsvclient) that interacts with users to send requests like listing available seats, reserving seats, and listing booked passengers. 3) The client can make requests to the server like reserving seats if available, checking availability, and listing current reservations. The server responds with the updated status and availability.

Uploaded by

Sohaib Choudhary
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Objective:

Objective of this assignment is to write a simple client-server network application using the Remote Procedure Call (RPC)
or the Remote Method Invocation (RMI) system. Description:
You will write a simple air-ticket reservation system, using RPC/RMI mechanism. The reservation server (rsvserver)
maintains the seat availability information and responds to client requests for reservation or availability. For simplicity, we
are concerned about one flight on one date only. The reservation information will be maintained only in memory, no need
to maintain a persistent database.

The flight contains 30 seats, 5 of business class and 25 of economy class. Price of ticket is a function of availability-

business class - first 3


tickets: $500 each next 2
tickets: $800 each economy
class - first 10 tickets: $200
each second 10 tickets: $300
each last 5 tickets : $450
each

Seats are numbered 1-5 for business class and 6-30 for economy class. For a particular class, the airline always sells
tickets at lowest available price.

The reservation client (rsvclient) interacts with user and sends requests to the server based on user input. User input is
taken as command line parameters, output is printed on the screen as text. In particular, the client may send the following
requests to the server.

rsvclient list <server_name>

lists all available seats in different classes and price ranges. For example, if there is 3 business class seats and 7 economy
class seats available, the output is –

business class: 1
seats at $500 each
2 seats at $800 each
Seat numbers: 3,6,9
economy class: 2
seats at $300 each
5 seats at $450 each
Seat numbers: 18,22,25,26,28,29,30
rsvclient reserve <server_name> <class> <passenger_name> <seat_number>
reserves the particular seat of the particular class for the particular passenger. Assume passenger name to be a single string
without space. Class name is either “business” or “economy”. Request may fail if invalid seat number is provided
(economy class seat number for business class reservation), or the given seat number is already sold.

Possible outputs

Successfully reserved seat #S for passenger N


Failed to reserve: invalid seat number Failed to reserve: seat not available rsvclient
passengerlist <servername> lists all booked passengers for both classes, including the seat
number assigned for each of them

Alice business 2
Bruce business 5
Melissa economy 10
John economy 12
Eric economy 13 Implementation

details:
You will implement both the rsvclient and the rsvserver program using either RPC or RMI. If you are more
familiar with C, use RPC, or, if Java is your favorite, use RMI. Your rsvclient should handle all the three user
requests. The rsvserver should maintain the reservation state and respond to the requests from the client pertaining
to all the three functions.

You might also like