程序代写代做代考 clock Java Lab 08 – File I/O and Network Socket

Lab 08 – File I/O and Network Socket
Objectives:
● ● ●
1.
Learn the concept of data streams and understand the difference between text data and binary data Learn to use various Java I/O classes for text and binary data
Learn to communicate with other Java programs by socket over a network
Write a class called PuzzleRotator that can read the Sudoku puzzle file format (given in Lab 4) and rotate the puzzle by 90-degree clockwisely. The puzzle is then saved to a new file using the original file name with a suffix “-rotated”.
The file content of 9b-rotated.txt
To set the output directory, you may configure the working directory as shown below.
[Self-checkpoint] Run your BacktrackSolver to solve the 9b-rotated puzzle. Does it become faster or slower after rotation?
[Homework] Create a client-server program that computes the inverse of a given matrix of integers.
a. Implement the methods specified in the class MatrixServer.java. During the lab, we will first implement a stub that just responses with the same matrix without real computation work. The purpose of this is to test the communication between the client programs. The matrix server must be able to handle simultaneous requests from multiple clients. You are required to submit the completed version of the matrix server as your 3rd homework assignment.
2.

b. Implement a client program (MatrixClient.java) that can read a matrix from a text file, connect to the server at a specific port, submit a matrix to the server for computation, and eventually print out the result (inverse matrix) replied from the server.
Two sample outputs are shown below where the left side is the original matrix and its inverse is on the right side.
The echo response from the stub server.
The inverse matrix response from the real matrix server.
– END –