Page 1 of 1

Rules: Assumed programming language is Java • Code that is handed in and does not compile will NOT be graded. So please

Posted: Fri Jul 01, 2022 5:38 am
by answerhappygod
Rules Assumed Programming Language Is Java Code That Is Handed In And Does Not Compile Will Not Be Graded So Please 1
Rules Assumed Programming Language Is Java Code That Is Handed In And Does Not Compile Will Not Be Graded So Please 1 (52.16 KiB) Viewed 23 times
Rules Assumed Programming Language Is Java Code That Is Handed In And Does Not Compile Will Not Be Graded So Please 2
Rules Assumed Programming Language Is Java Code That Is Handed In And Does Not Compile Will Not Be Graded So Please 2 (32.08 KiB) Viewed 23 times
Rules Assumed Programming Language Is Java Code That Is Handed In And Does Not Compile Will Not Be Graded So Please 3
Rules Assumed Programming Language Is Java Code That Is Handed In And Does Not Compile Will Not Be Graded So Please 3 (41.72 KiB) Viewed 23 times
Rules: Assumed programming language is Java • Code that is handed in and does not compile will NOT be graded. So please make sure to test your implementation properly. • Assignments have to be solved individually. It is ok and also desired to discuss problems with peers, whereas copying code is not. As a result, plagiarism will lead to-5 points for the particular assignment for both parties. The due date is a hard deadline. E-mails that arrive after this deadline will be discarded and therefore the contained solution not graded. Overview: The purpose of this assignment is to gain experience in developing a distributed application using Java RMI. You will design and develop a distributed Hotel Booking application based on RMI. Problem Description: A distributed Hotel Booking system consists of the hotel server and the client machine. The server manages hotel rooms booking information. A customer can invoke the following operations at his machine. 1- public void book (int NumberOfGuests, int NumberOfNights, String CustomerName, Date checkinDate)throws RemoteException; // this operation will book a room for the specific guest and return nothing 2- public boolean cancelBooking (String CustomerName)throws RemoteException; // this operation cancels the booking of a user, and returns true if the booking was cancelled successfully 3- public Date inquiry(String CustomerName) throws RemoteException; // this operation returns the check-in date for customer.
2- Server public class HotelServer extends UnicastRemoteObject implements otelinterface 1/guests' name f private Vector Customers; private Vector CheckinDate: //guests' check-in Date private Vector NumOf Nights: //guests' number of nights staying private Vector NumbofGuest;// number of guests boclean done, public HotelServer() throws RemoteException ( //implementation] public void book (int NumberOfGuests, int NumberOfNights String CustomerName, Date checkinDate) throws Remote Exception ( //implementation public boolean cancelBooking(String CustomerName) throws RemoteException 1 //implementation public Date inquiry String CustomerName) throws RemeteException ( //implementation) public static void main(String args) throws Exception 1 //init Hotel server) The Hotel server has only one input parameter "server port", which specifies the port of miregistry. The default port of rmiregistry is 1099, but we may have to use other ports, if 1099 has already been used by some other programs. 3- Customer (Client) public class Customer f public static void (String args[] throws Exception ( //get user's input, and perform the operations The input parameters of a Customer must include • server address the address of the miregistry • server port: the port of the registry • operation: one of "book", "cancelBooking", and "Inquiry" CustomerName: assume it is unique for every user • CheckinDate: entered in the book operation • NumberOfNights: entered in the book operation • NumberOfGuests: entered in the book operation
public boolean cancelBooking(String CustomerName) throws RemoteException { //implementation } public Date inquiry(String CustomerName) throws RemoteException ( //implementation } public static void main(String args[]) throws Exception { //init Hotel server) The Hotel server has only one input parameter "server_port", which specifies the port of rmiregistry. The default port of rmiregistry is 1099, but we may have to use other ports, if 1099 has already been used by some other programs. 3- Customer (Client) public class Customer ( public static void (String args[]) throws Exception ( //get user's input, and perform the operations The input parameters of a Customer must include: • server_address: the address of the rmiregistry • server_port: the port of the rmiregistry • operation: one of "book", "cancelBooking", and "Inquiry" • CustomerName: assume it is unique for every user • CheckinDate: entered in the book operation • NumberOfNights: entered in the book operation • NumberOfGuests: entered in the book operation Grading: Implementing client-side (2 points) Implementing server-side (2 points) Well-formed and documented code (1 Points) Note: Projects should be sent to the course email: [email protected] as zip file. The Email must be titled: PA#1 Your ID-Your Name. You must send the email before Tuesday Midnight