Page 1 of 5 COIT13229 Applied Distributed Systems Assignment 1 – Java Client/Server Application Due date: Week 5 Friday (9th April XXXXXXXXXX:45 PM AEST ASSESSMENT Weighting: XXXXXXXXXX% XXXXXXXXXX1...

I need a working code that matches the assignment specifications attached please.


Page 1 of 5 COIT13229 Applied Distributed Systems Assignment 1 – Java Client/Server Application Due date: Week 5 Friday (9th April 2021) 11:45 PM AEST ASSESSMENT Weighting: 30% 1 Objectives This assessment item is designed to test your understanding in Java UDP networking, Java Object Serialization/Deserialization, file reading and writing using a client/server application development. Assessment task A local city council proposed an innovative plan to reduce the number of private cars on the inner-city roads.Under the new proposal residents will be given five capped free travels on the public transport(rail/bus/ferry) during the day. Residents will be issued a membership card with a client id and pin number to be used for sign-in and sign-off at kiosks before boarding and after exiting the service. Each travel over the capped limit will be charged a flat rate of $3.00. The application should be implemented as a client/server model using java UDP sockets. The client program handles all the data entry and menu selections (1. In 2. Out 3. Exit). The java datagram packet uses connectionless communication and allows multiple clients to communicate concurrently with the UDP server. A sample of the parsed string message by the client to the server is shown below. Only the client id and pin number are to be entered by the user. Example) ”S101:1234:In” or ”S101:1234:Out” with delimiter used here shown as “:”. Remove any trailing spaces from the byte array after converting it to a string using java inbuilt String.trim() method. All validations should be processed only on the server side. Appropriate validation/Error messages: 1. Invalid client (The client id does not exist on the server) 2. Invalid password (The password for the client id does not match) 3. Already signed-in (Attempt to sign-in without sign-off) 4. Already signed-out (Attempt to sign-off without sign-in) 5. Welcome 6. Good bye The server should use an appropriate data structure preferably an Array List to hold customer records loaded from a text file(“Member.txt”). The server should also persist the data structure contents by serialising each customer instance in the data structure to a binary file(“Member.dat”) every 2 minutes. Page 2 of 5 Coding and Design You can use the following class descriptions as a guideline for your design. Customer: This class should implement serializable with relevant instance variables (Refer to figure 1). WriteToFile: This class should flush the contents of the data structure by serializing each customer instance to a binary file “Member.dat” using java ObjectOutputStream. UDPClient: This class handles the data entry with suitable menus and interacts with the user. This program builds a plain text message before parsing it to the server. The program should allow the client to enter the details for multiple entries. UDPServer: This server loads existing records from a text file (“Member.txt”) to an appropriate data structure. A timer function should be used to schedule and call WriteToFile at regular intervals. The server program should be running indefinitely ready to communicate with all future clients. The server should display the customer details after a successful update operation. Figure 1(Design) The source code should be formatted properly following good programming practice (appropriate variable names, indentation, comments, etc.…) Page 3 of 5 Sample Screenshots The following screenshots show example outputs of the above program. You should only use these as references. Your program outputs can be similar but not necessarily the same. Member.txt Member.dat Client1 Client2 Page 4 of 5 Output on UDPServer: Report Run the program and take screenshot of program outputs for all tests with annotations. Assessment Submission You should submit one Zip file containing the following files using the Moodle online submission system, by the due date: • Customer.java –Source code for the Customer class • UDPClient.java –Source code for the UDPClient class. • UDPServer.java –Source code for the UDPServer class • WriteToFile – Source code for the WriteToFile class (This class can also be provided inside UDPServer.java as an inner class) • Report.docx – A document file containing details as outline above. Note: 1. If your program doesn’t compile or run, partial marks will be allocated by inspection of the source code. 2. Your understanding of the program will be examined using the tests provided in the report and the detailed java doc comments inserted in your source code files. 3. Please clarify any doubts you have by one of the means of discussing with your tutor, posting a query in the Q& A forum, or discussing with your colleagues or contacting the unit coordinator. 4. Please do not share your source code files or report with your colleagues which may lead to plagiarism. Page 5 of 5 Assessment Item 1 Marking criteria S. No Total Marks - 30 Marks 1 Client/Server application using java UDP sockets to send and receive. (Zero marks otherwise) 5 2 UDP client program with correct functionality and interaction messages. 1.Invalid client 2. Invalid password 3. Already signed-in 4. Already signed-out 5.Welcome 6. Good Bye. 7.Menu handling. 7 3 UDP server program with correct functionality 1.Loads text file 2. Schedules timer 3.Uses data structure 4. Display output 5.runs indefinitely. 6 4 WriteToFile class extends TimerTask and serializes customer instances to a binary file 5 5 Customer class adheres to the UML diagram and implements serializable. 3 6 Good coding practices (Indentation, Comments, Naming Conventions, Readability) 2 7 Screen shots of running programs to cover all tests 2 Sub-total 30 Penalties Late penalty -1.5 (5% per Calendar day) Plagiarism As per policy Total 30 S0001 1981 S0002 1983 S0003 1985 S0004 1991 S0005 1993 S0006 1978 S0009 2000
Mar 30, 2021COIT13229Central Queensland University
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here