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
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