INFO I211 Lab 7
Palindrome Client/Server and Unix Utilities
Due date: extended to April 16, 2012; last chance April 23, 2012, 11:59 p.m. EDT
60 points
Due date: extended to April 16, 2012; last chance April 23, 2012, 11:59 p.m. EDT
60 points
Instructions for this lab are likely to change.
Two students may work as a team on this project. Working together is recommended for this project. Student teams will turn in one copy of their solution and will receive equal credit for their work.
Develop the palindrome checker of Lab 4 into a client-server application.
Learning objective: ability to develop a program with network communication using sockets.
Prerequisites: Chapters 1–6 and 11; lecture notes on network I/O.
t
— is it a palindrome? The server determines whether
it is a palindrome and sends the decision to the client.java MyServer 8123, where 8123 is the
port on which the server will listen for connections;
and terminate it with control-C.println method to send it
and the Scanner.nextLine method to receive it.
The client just sends the string to be
tested,
the server send a response of "yes" or "no", and
the client can just disconnect when finished, like this:
CLIENT: lol
SERVER: yes
CLIENT: lack
SERVER: no
(CLIENT disconnects)
nc before putting them together.
Don't expect them to work together unless each one
works separately.It is a good idea to separate the user interface of a program from its application logic. The user interface has to do with how it interacts with the computer user, getting inputs and delivering outputs; the application logic has to do with how it processes the data. Most of you did not separate these two concerns in Lab 4. If you had separated them, you would find this new lab a bit easier.
So, why didn't I tell you that back in Lab 4? Well, if I had, would you really learn the lesson? Or do you need to experience the consequences of bad program design, in order for the virtue of good design principles to sink in?
Pairs of students who work together: Make sure that both of your names appear on all submitted source files, in the header comments. Either student may submit the work in Oncourse Assignments 2, but must credit the other student as a partner in the "Submitted text" for the assignment.
TOTAL: 60 points