Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the scenario given below, write and execute a Client - Server application using Java Socket programming and File handling as per the description below.The

Using the scenario given below, write and execute a Client-Server application using Java Socket programming and File handling as per the description below.The XYZ Fitness Tracker app enables trainers to track their session earnings. Trainers input the trainer id, session fee and the number of sessions conducted. You can take any values for the fees and number of sessions.This data is sent to the server for total earning, commission calculation and the feedback.The server calculates the total earnings by multiplying the session fees and the number of sessions.The commission is calculated based on the scheme given below:If a trainer earns more than or equal to 500 OMR in a month, they receive a 7% commission on the total earnings; If a trainer earns between 200 OMR to 500 OMR in a month, they receive a 3% commission on the total earnings, if they earn less than or equal to 200 OMR, they receive a 1% commission on the total earnings.Based on the commission the feedback is also given to the trainer.* Commission>=100 : feedback="excellent"* Commission between 50 and 100: feedback="need to upgrade the number of clients"* Commission <=50 : feedback="you may be fired soon"The server then sends back to client: the trainer id, total earnings, commission, and feedback to the client side for display to the trainer.Task : The server side.a. Ensure that the necessary packages are importedb, Implement the program structure including the class, the main method, and the exceptionC. Create necessary objects to allow for setting up connection point, reading data from the network, and sending data over the networkd. Read appropriate data from the client and send result to the cliente. Implement and ensure connection request can be acceptedf. Do the necessary calculationsg. Appropriate use of variablesh. Shut down the communication once done

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

Students also viewed these Databases questions