Implement a driver program to test out all constructors, JAVA Programming

Assignment Help:

Implement a class Book (Book.java). A book will have three instance variables: a title (a String, for example: "Big Java" or "The Hitchhiker's Guide to the Galaxy"), an author (a String, for example: "Cay Horstmann" or "Douglas Adams") and a price (a double, for example: 80.00 or 24.99). The class must include a:

  • Default constructor,
  • Parameterized constructor with three parameters (title, author, and price),
  • Accessor method to return the title,
  • Accessor method to return the author,
  • Accessor method to return the price,
  • Mutator method to set the title,
  • Mutator method to set the author,
  • Mutator method to set the price.

Implement a driver program (BookTest.java) to test out all the constructors and methods of your class as follows:

  • Create at least two Book objects, one using the default constructor and one using the parameterized constructor.
  • Use themutatormethods to set the title, author, and price for the Book object that was created using the default constructor.
  • Use theaccessormethods to get information that is then printed in sentences containing the author, title, and price of each book. An example sentence might be, "The Big Java book by CayHorstmanncosts $69.99." (Note that some of the information in this string comes from the values of your instance fields and the rest is text that you supply.

Document your Book class completely, using the appropriate Javadoc tags in your code. Include comments for the class, instance fields, and all methods. Use the JavaDocutility to generate an HTML documentation page for your Book class. In grading your project, we will generate the JavaDoc file from your source code file, so you do not have to turn it in.

You should have three files for this project:

    Book.java                     The Book class that has all the constructors and methods 
    BookTest.java               A driver program to test your Book class
    Book.html                     The documentation file generated from your Book class


Related Discussions:- Implement a driver program to test out all constructors

What is the use of mapmessage, A MapMessage carries name-value pair as its ...

A MapMessage carries name-value pair as its payload. Therefore its payload is same to the java.util.Properties object of Java. The values can be Java primitives or their wrappers

Combo box and Check box help, Sal?s Pizza wants to install a system to reco...

Sal?s Pizza wants to install a system to record orders for pizza and Buffalo chicken wings. When regular customers call Sal?s Pizza on the phone, they are asked their phone number.

I clicker, i am to find 75% of i clicker score.Each correct answer is worth...

i am to find 75% of i clicker score.Each correct answer is worth 2points and an incorrect 1point. Express grade as a percentage (i.e the max is 100%). e.g 1 no i clicker question

Api consumer, API consumer -This application should consume a third pa...

API consumer -This application should consume a third party API -You should use more than just one method of the API, I'd like to see at least 3 or 4 -Have some concept

Probability, Mike sells on the average 15 newspapers per week (Monday – Fri...

Mike sells on the average 15 newspapers per week (Monday – Friday). Find the probability that 2.1 In a given week he will sell all the newspapers [7] 2.2 In a given day he will se

In javascript, In JavaScript, what is event handling? What are the two type...

In JavaScript, what is event handling? What are the two types of events? In JavaScript capturing events and responding to them is event handling. The system sends events to the

For statement in javascript, A for loop repeats until a specified condition...

A for loop repeats until a specified condition evaluates to false. For for loop the JavaScript is similar to the Java and C for loops. A for statement looks as:  for ([initial-

Networking, which concept is used to connect the networking in java

which concept is used to connect the networking in java

Describe about applet security, Describe about Applet Security? The pos...

Describe about Applet Security? The possibility of surfing the Net, wandering across a random page, playing an applet and catching a virus is a fear in which has scared several

2d world of ants and doodlebugs, We have to create a world class that conta...

We have to create a world class that contains a 2d array then create an abstract class called organism that contains move() method the organism should move randomly one step at the

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd