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

Write code in javascript language to show the odd numbers, Write code in Ja...

Write code in JavaScript language to show the odd numbers among 20 to 100 using FOR statement. Note: No requirement to write whole HTML program. Just JavaScript code of need p

Name conflicts when importing packages, Name Conflicts when importing packa...

Name Conflicts when importing packages It is possible which you will try to import a package which contains classes in which have the similar name as a class in your own source

JAVA IF/ ELSE, #This assignment will give you practice with interactive pro...

#This assignment will give you practice with interactive programs, if/else statements and methods that return values. You are to write a program that prompts the user for informati

Opps Concepts, 300 words on oops and 1 program for each concepts

300 words on oops and 1 program for each concepts

Medical services referral system - websphere administrator, Medical Service...

Medical Services Referral System:       Role : Websphere Administrator       Involved in Exposure to load balancing tools (BigIP, WAS plug-ins) and Siteminder.

String, in java string is a

in java string is a

What restrictions are placed on method overriding, What restrictions are pl...

What restrictions are placed on method overriding? Overridden methods must have the similar name, argument list, and return type. The overriding method may not limit the access

Query example in sparql - java and jena api, Exercise 1) Lets start by quer...

Exercise 1) Lets start by query example in SPARQL: QUERY: What are the school's names that belong to the "local authority district" 00AA? NOTE 1: "Authority districts" divide UK i

How to retrieve warnings, SQLWarning objects are a subclass of SQLException...

SQLWarning objects are a subclass of SQLException that deal with database access warnings. Warnings do not stop the implementation of an application, as exceptions do; they easily

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