Exercises

October 23 - 27, 2006

  1. Complete exercises PP3.1 from the text. Write an application that prompts for and reads the user's first and last name (separately). Then, print a string composed of the first letter of the user's first name, followed by (no more than) the first five characters of the user's last name, followed by a random number in the range 10 to 99.
  2. Complete exercises PP4.4. Design and implement a class called Book that contains instance data for the title, author, publisher, and copyright date. Define the Book constructor to accept and initialize this data. Include setter and getter methods for all instance data. Include a toString method that returns a nicely formatted , multi-line description of the book. Create a driver class called BookShelf, whose main method instantiates and updates several Book objects.


Sami Rollins