In this assignment, you are requested to build a system which allows a school pupil to practise multiple choice tests in math. Design and implement a RMI-based Client / Server communication system in Java, which will do the following:

Client:

  • Connect to server via client_stub.
  • Read and display the prompt message sent (see step s2 in server) by the server.
  • Receives and displays the first math question plus three possible answers from the server.
  • User then selects and inputs only one answer and the client program sends the answer to the server. This process is repeated three times to complete all 3 questions from the server Questions database
  • After the test is over the client accepts and displays the test results and score from the server.

Server:

  • [Initialization] Create a RMI-based server which implements a test interface.
  • Wait for a client connection.
  • When a client connection is accepted send an acknowledgement (a welcome message) as a sting of text.
  • From Questions database, server sends the first test questions plus three possible answers to the client.
  • Receives the answer from the client. Stores and evaluates the answer. This process is repeated three times.
  • After that the server sends all results and score to the client.
  • Close the connection to the client and then loop back and wait for another connection.

Questions database:

Q1: (A + B)*(A+B)
1. A*A + B*B
2. A*A +A*B + B*B
3. A*A +2*A*B + B*B (correct)

Q2: (A + B)*(A - B)
1. A*A + 2*B*B
2. A*A - B*B (correct)
3. A*A -2*A*B + B*B

Q3: sin(x)*sin(x) + cos(x)*cos(x)
1. 1 (correct)
2. 2
3. 3

Note: All the communication between the Client and the Server should be in the form of strings.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.