Section 15.13 Exercises
Note: For programming exercises, first draw a UML class diagram describing all classes and their inheritance relationships and/or associations.
Explain the difference between each of the following pairs of terms:
Stream and socket.
Internet and internet.
Domain name and port.
Client and server.
Ethernet and Internet.
URL and domain name.
What is a protocol? Give one or two examples of protocols that are used on the Internet.
What service is managed by the HTTP protocol?
Give examples of client applications that use the HTTP protocol.
Why is it important that applets be limited in terms of their network and file system access? Describe the various networking restrictions that apply to Java applets.
What does the
Internet Protocoldo? Describe how it would be used to join an ethernet and a token ring network.
Describe one or two circumstances under which a
ConnectExceptionwould be thrown.
SlideShowFrameso that it plays an audio file along with each slide.
Design and implement a Java applet that downloads a random substitution cryptogram and provides an interface that helps the user try to solve the cryptogram. The interface should enable the user to substitute an arbitrary letter for the letters in the cryptogram. The cryptogram files should be stored in the same directory as the applet itself.
Design and implement a Java application that displays a random message (or a random joke) each time the user clicks a
GetMessagebutton. The messages should be stored in a set of files in the same directory as the applet itself. Each time the button is clicked, the applet should download one of the message files.
Write a client/server application of the message or joke service described in the previous exercise. Your implementation should extend the
Write an implementation of the scramble service. Given a word, the scramble service will return a string containing all possible permutations of the letter combinations in the word. For example, given “man,” the scramble service will return “amn, anm, man, mna, nam, nma.” Use the
Clientclasses in your design. (See the Self-Study Exercises for a description of the design.) Challenge: Modify the Nim server game in this chapter so that the client and server can negotiate the rules of the game, including how many sticks, how many pick ups per turn, and who goes first.