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

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

Posted Date: 3/6/2013 4:29:56 AM | Location : United States







Related Discussions:- Implement a driver program to test out all constructors, Assignment Help, Ask Question on Implement a driver program to test out all constructors, Get Answer, Expert's Help, Implement a driver program to test out all constructors Discussions

Write discussion on Implement a driver program to test out all constructors
Your posts are moderated
Related Questions
Write a program to add integer value? class AddInts { public static void main (String args[]) { int i = 1; int j = 2; System.out.println("i is " + i); System.out.println("

eAgro Portal Project: Technology Used: Java Server Faces, JSR 168 Specification, Websphere Portal Server5.0, DB2 database And Rational Application Developer, Jasper Report Too

Differentiate between SMTP and POP3 server? SMTP (Simple Mail Transfer Protocol) is a protocol used to send and receive eMail messages over a TCP/IP network. While POP3 (Post

Vehicle Loan Application: Type                                         Web-based Application Role                                          Weblogic administrator + develop

A joinpoint is a point in the implementation of the application where an aspect can be plugged in. This point could be a method being called, an exception being thrown, or even a f

Normal 0 false false false EN-US X-NONE X-NONE

Explain switch statement in java language? Switch statements are shorthands for a certain type of if statement. It is not common to see a stack of if statements all related

Write a AXIS2 SOAP Java Web Service that performs a bidirectional currency conversion for the following currencies- GBP, EUR and USD (American Dollar). You are allowed to hardco

Application or website to upload DICOM files from CD to Drop box etc Project Description: I need a website code or application to make patients put a cd or DVD to their disk

I want android expert Project Description: I have too many android project pending anyone who will start work right away, with me will bid here , only bid if you can work rig