Basic Java Program Help

profilechrizlo
a2.pdf

1. Write a program that generates a random integer in the range 20 to 40, inclusive, and displays t

he sine, cosine, and tangent of that number. 2. Write a class called Book that contains instance data for the title, author, publisher, and copyri

ght 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 form atted, multi-

line description of the book. Create a driver class called Bookshelf, whose main method instantiates and updates several Book objects.

3. Using the Die class defined in this chapter, write a class called PariOfDice, composed of two

Die objects. Include methods to set and get the individual die values, a method to roll the di ce, and a method that returns the current sumof the two die values. Create a driver class calle d RollingDice2 to instantiate and use a PairOfDice object.