Download the Java_homework project file from here. Import this into Eclipse by selecting File | Import | “General” | “Existing Projects into Workspace”.
- Sphere
Design and implement a class called Sphere that contains instance data that represent a sphere’s diameter. Define a Sphere constructor to accept and initialize the diameter. Include getter and setter methods for the diameter. Include methods to calculate and return the volume and surface area of the sphere. Include a toString method that returns a one-line description of the sphere. Create a driver class called MultiSphere, whose main method instantiates and updates several Sphere objects.
- Books
Design and implement a class called Book that contains instance data for title, author, publisher and copyright date. Define that Book constructor to accept and initialize these data. Include setter and getter methods for all instance data. Include a toString method that returns a nicely formatted, multiline description of the book. Create a driver class called Bookshelf, whose main method instantiates and updates several Book objects.
- Bulb
Design and implement a class called Bulb that represents a light bulb that can be turned on and off. Create a driver class called Lights, whose main method instantiates and turns on some Bulb objects
- Account
Modify the Account class from the unit examples so that it also permits an account to be opened with just a name and an account number, assuming an initial balance of zero. Modify the main method of the Transactions class to demonstrate this new capability.
- Cards
Design and implement a class called Card that represents a standard playing card. Each card has a suit and a face value. Create a program that deals five random cards.