Question: For this task, you'll be crafting both a client and a server in c + + . The aim is to enhance your ability to
For this task, you'll be crafting both a client and a server in c The aim is to enhance your ability to write compatible code. Specifically, you're building a clientserver system for managing and analyzing test grades. Here's how the protocol operates:
The client connects to the server via TCPIP on port Security concerns are disregarded for this exercise.
Upon connection, the server sends the message "COURSEID" to the client.
The client responds with a packet containing:
A fourcharacter string denoting the course subject area.
A sixteenbit signed integer for the course number.
A sixteenbit signed integer for the section number.
Upon receiving this, the server replies with "MAX SCORE".
The client then sends a packet containing:
A sixteenbit signed integer representing the maximum possible test score.
The server acknowledges with "BEGIN".
Subsequently, the client transmits test scores, one per packet, in this format:
A signed bit integer for the student's ID ranging from
A signed bit integer for the test score.
The client continues until it completes, using as both student ID and test score, and then waits for the server's response.
The server replies with a packet containing:
Client's IP address bit integer
Client's Port number bit integer
Course information character ASCII string
Number of total scores received excluding sentinel value
Number of valid scores received.
Lowest score.
Highest score.
Average score bit floating point
Standard deviation bit floating point
The client then sends "ERRORS".
The server responds with "ERRORS", followed by packets indicating erroneous student IDs and test scores.
Finally, the server sends a packet with as both student ID and test score to indicate completion, and closes the connection.
The server ensures results are printed for each client separately, preventing data overlap. It also prints client IP and port before handling, and result info before transmitting.
The client reads data from a file, where:
The first line contains course details.
The second line has the maximum possible score.
Subsequent lines list student IDs and their respective test scores.
The client sends scores individually with a random second delay between packets.
The client sends as sentinel values when done.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
