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.

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 500OMR 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.
Program Requirements (or tasks):
Task 1: The client side
a. Ensure that the necessary packages are imported
b. Implement the program structure including the class, the main method, and the exception handling
c. Create necessary objects to allow for setting up connection point, reading data from the keyboard, sending data over the network, and reading data from the network 110 mark
d. Read appropriate data from the keyboard, sent it to the server, and receive the result fro the server
e. Appropriate use of variables
f. Display the result
marl
mar
4 mar
mai
g. Shut down the communication once done
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions