Practice Hands-on Exam

 

Instructions:

 

Write a client program that connects to curry.ateneo.net and upon

establishing a connection through port 12345, performs the

following tasks, in the order indicated:

 

1)                Send your last name

2)                Receive a number; let this number be N

3)                Receive N lines, each line containing either the string "Java" or the string "OOP".  Note:  you will need to count the number of times the string "OOP" was sent to you.

4)                Send the number N

5)                Receive the string "OK"

6)                Send the number X, where X represents the number of times the string "OOP" was sent in step 3.

7)                Receive the string "OK"

 

If you received two OK then you completed the exercise.

 

NOTE: You have to be connected to the Internet to test this program.