Question
Asked by:
missprince
missprince
Rating : No Rating
Questions Asked: 6
Tutorials Posted: 0
 

$15.00 Book class question

Q:

I have my code but I don't like my solution.  It prints the information that is written into the code and I'd prefer  it to be written from a separate text file.  Here is the question.

Create a Book class that stores book information. Your book class will store book title, author’s first name, author’s last name, book ISBN-10 number, and publisher, and price. Ensure you have created appropriate constructor(s) that will allow your test application to construct objects of type Book.

You can decide how to obtain the information used for each Book object you create. Each book’s information can be entered through the keyboard, read in from a file, or constructed by using hard coded values in your test application.

Create a test application that creates several objects of type Book class and adds each Book object to an ArrayList. Do not store your book information as a String and add this String into your ArrayList. You should store Book objects that encapsulate your book information and store these in your ArrayList:

//Creates arrayList to store book objects
ArrayList bookList = new ArrayList();

Your test application should then do the following:

  1. Iterate through all Books in the ArrayList and print the information out in readable form.
  2. Print the total number of books stored.
  3. Prompt you for an index and print the book information stored in the index.

Hint: You may want to look into overriding toString() method to provide a readable string representation of Book object.

 
Attachments:
Book.zip (15K)


   
   
   
   
 
Available Tutorials to this Question
Posted by:
 

$15.00 A+ solution -- Load data from file.

  • This tutorial hasn't been purchased yet.
  • Posted on Nov 01, 2009 at 9:30:44PM
A:
Preview: ... ee th ...

The full tutorial is about 4 words long plus attachments.

Attachments:
Book.java (0K) (Preview)
TestBooks.java (2K) (Preview)
book.txt (0K) (Preview)
Posted by:
rannok_026
rannok_026
Rating (200): A-
Questions Asked: 5
Tutorials Posted: 1453, earned $4,809.95
 

$10.00 Book class question

  • This tutorial hasn't been purchased yet.
  • Posted on Nov 01, 2009 at 11:36:06PM
A:
Preview: ... ee the a ...

The full tutorial is about 5 words long plus attachments.

Attachments:
BookApplication.zip (1K) 

 BookApplication.java
 ]

BookApplication2.zip (14K) 

 BookApplication/nbproject/project.xml
 BookApplication/nbproject/private/private.properties
 BookApplication/nbproject/project.properties
 BookApplication/nbproject/build-impl.xml
 BookApplication/nbproject/genfiles.properties
 BookApplication/build.xml
 BookApplication/src/BookApplication.java
 BookApplication/manifest.mf
 BookApplication/build/classes/Book.class
 BookApplication/build/classes/BookApplication.class
 BookApplication/build/classes/BookApplication.rs
 BookApplication/build/classes/.netbeans_automatic_build
 ]

Posted by:
modulo51
modulo51
Rating (110): A-
Questions Asked: 1
Tutorials Posted: 353, earned $2,117.64
 

$15.00 Java: 3 classes, BookInventory, Scanner input of bookdata, ArrayList<Book>, NetBeans project, UseNotes, ScreenShot

  • This tutorial was purchased 1 time and rated A+ by students like you.
  • Posted on Nov 04, 2009 at 11:41:38PM
A:
Preview: ... toryLogic.bookInfoAtIndex();                     break;                 case 4: // quit                     break;                 default:                     System.out.println(                             "Not a valid choice, please try again.");             }         } while (choice != 4);     }     static int menu() {         String line;         int choice = 0;         while (true) {             System.out.println(                     "\n\tMain Menu\n" +                     " 1 - Iterate through Book list and print " +                     "information for each book.");             System.out.println(                     " 2 - Print the total number of books stored.");             System.out.println(                     " 3 - Get book information at an index ...

The full tutorial is about 380 words long plus attachments.

Attachments:
CombinedJavaFiles.txt (10K) (Preview)
BookInventoryUseNotes.txt (5K) (Preview)
BookInventoryOutput.jpg (75K) (Preview)
BookInventoryZipped.zip (81K) 

 BookInventoryZipped/BookInventory/bookdata.txt
 BookInventoryZipped/BookInventory/build.xml
 BookInventoryZipped/BookInventory/build/classes/.netbeans_automatic_build
 BookInventoryZipped/BookInventory/build/classes/Book.class
 BookInventoryZipped/BookInventory/build/classes/BookInventoryDriver.class
 BookInventoryZipped/BookInventory/build/classes/BookInventoryLogic.class
 BookInventoryZipped/BookInventory/dist/BookInventory.jar
 BookInventoryZipped/BookInventory/dist/README.TXT
 BookInventoryZipped/BookInventory/manifest.mf
 BookInventoryZipped/BookInventory/nbproject/build-impl.xml
 BookInventoryZipped/BookInventory/nbproject/genfiles.properties
 BookInventoryZipped/BookInventory/nbproject/private/private.properties
 BookInventoryZipped/BookInventory/nbproject/private/private.xml
 BookInventoryZipped/BookInventory/nbproject/project.properties
 BookInventoryZipped/BookInventory/nbproject/project.xml
 BookInventoryZipped/BookInventory/src/Book.java
 BookInventoryZipped/BookInventory/src/BookInventoryDriver.java
 BookInventoryZipped/BookInventory/src/BookInventoryLogic.java
 BookInventoryZipped/BookInventoryCombinedJavaFiles.rtf
 BookInventoryZipped/BookInventoryOutput.html
 BookInventoryZipped/BookInventoryOutput.jpg
 BookInventoryZipped/BookInventoryOutput.txt
 BookInventoryZipped/BookInventoryUseNotes.txt
 BookInventoryZipped/oldProgramFiles.txt
 ]

Posted by:
hallucination1s
hallucination1s
Rating : No Rating
Questions Asked: 14
Tutorials Posted: 3, earned $0.00
 

$15.00 Book class made in netbeans

  • This tutorial hasn't been purchased yet.
  • Posted on Nov 10, 2009 at 6:03:33PM
A:
Preview: ... XXXXXXXXXX, Price: $30.99 Total of books stored: $62.19 Enter the index of a book: 2 Title ...

The full tutorial is about 73 words long plus attachments.

Attachments:
BookApplication.zip (14K) 

 BookApplication/build.xml
 BookApplication/build/classes/.netbeans_automatic_build
 BookApplication/build/classes/Book.class
 BookApplication/build/classes/BookApplication.class
 BookApplication/build/classes/BookApplication.rs
 BookApplication/manifest.mf
 BookApplication/nbproject/build-impl.xml
 BookApplication/nbproject/genfiles.properties
 BookApplication/nbproject/private/private.properties
 BookApplication/nbproject/project.properties
 BookApplication/nbproject/project.xml
 BookApplication/src/BookApplication.java
 ]

   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty