Java Reference
In-Depth Information
receives the count from the server and display a message, such as You are visi-
tor number 11, as shown in Figure 31.19. Name the client Exercise31_04Client
and the server Exercise31_04Server.
F IGURE 31.19
The client displays how many times the server has been accessed. The server stores the count.
31.5
( Send loan information in an object ) Revise Exercise 31.1 for the client to
send a loan object that contains annual interest rate, number of years, and loan
amount and for the server to send the monthly payment and total payment.
Section 31.6
31.6
( Display and add addresses ) Develop a client/server application to view and
add addresses, as shown in Figure 31.20.
F IGURE 31.20
You can view and add an address.
Use the StudentAddress class defined in Listing 31.5 to hold the name,
street, city, state, and zip in an object.
The user can use the buttons First , Next , Previous , and Last to view an
address, and the Add button to add a new address.
Limit the concurrent connections to two clients.
Name the client Exercise31_06Client and the server Exercise31_6Server.
*31.7
( Transfer last 100 numbers in an array ) Programming Exercise 22.12 retrieves
the last 100 prime numbers from a file PrimeNumbers.dat . Write a client
program that requests the server to send the last 100 prime numbers in an
array. Name the server program Exercise31_07Server and the client program
Exercise31_07Client. Assume that the numbers of the long type are stored in
PrimeNumbers.dat in binary format.
*31.8
( Transfer last 100 numbers in an ArrayList ) Programming Exercise 24.12
retrieves the last 100 prime numbers from a file PrimeNumbers.dat . Write a
client program that requests the server to send the last 100 prime numbers in
an ArrayList . Name the server program Exercise31_08Server and the client
program Exercise31_08Client. Assume that the numbers of the long type are
stored in PrimeNumbers.dat in binary format.
 
Search WWH ::




Custom Search