7.4 Exercises

1. Waving Duke

Make a continuous animation of the Java Duke waving its hand. Make sure that there is an interval at a natural moment. The images are in ../images/duke.

2. Blinking Square

Make a blinking square as in the applet below.

3. Encryption Revisited

In an exercise of chapter 4, we have practiced encryption of strings. Now we use that material to encrypt a file. So the input is an ordinary text file, and the output is the same file encrypted.

4. Writing a Table

In the text there is an example of reading an ASCII table into an array. The goal of this exercise is to make a converse. Suppose you have an two dimensional array of doubles, write the data to file in tabular format. The separation should be done with help of tabs ("\t").

5. Writing a Binary Format

Write an application that converts a file with doubles in ASCII format (separated by newlines) into binary format. You can test your application with help of the converse, which can be found in the text.