Skip to content

pramit-marattha/Java-practice-with-solution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Download the Java_homework project file from here. Import this into Eclipse by selecting File | Import | “General” | “Existing Projects into Workspace”.

  1. 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.

  1. 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.

  1. 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

  1. 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.

  1. 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.

About

Programming Projects:

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages