Assignment 4

Due before class on Friday, May 8th

  1. a) Create an abtsract class (with at least one abstract method) with two or more subclasses, and write definitions for each of the three classes.
    b) Write an applet which uses polymorphism to call one of the abstract methods in your abstract class.
  2. Exercise 5.35 You should write an applet which lets a user type in a string (into TextField), and then converts the string into an array of characters. Your applet should then call the stringReverse() method, and pass it the newly created array of characters. Your method should then print the reversed string.
  3. Exercise 6.14
  4. Exercise 6.15
  5. Exercise 7.13
  6. OPTIONAL If you prefer, you can solve this problem, rather than problem 2 (Exercise 5.35).

    Create an image map class which displays an image, and prints a different message in the status bar depending on the current mouse location. Your image map class should accept a double-subscripted array which defines the regions in the image, and each region gets its own message. When the mouse is in a region, that region's message is displayed.

    You'll need a few more tricks in your toolbox to do this: