Question
Java Write Book class with attributes, title, author, publisher, isbn and price. Book class has method calculateCharge that accepts the quantity sold and returns the
Java
- Write Book class with attributes, title, author, publisher, isbn and price. Book class has method calculateCharge that accepts the quantity sold and returns the total charge.
- Data will be in a two-dimensional data array as follows:
Abraham Lincoln Vampire Hunter, Grahame-Smith, Wiley,978-04465 63079, 13.99
Frankenstein, Shelley, Prescott, 978-0486282114, 7.99
Life of Kennedy, Jones, Pearson, 758-29304566, 12.90
Dracula, Stoker, Addison, 978-0486411095, 5.99
Curse of the Wolfman, Hageman, Wesley, B00381AKHG, 10.59
How to Pass Java, Willis, Wiley, 444-395869790, 1.99
The Mummy, Rice, Addision, 978-0345369949, 7.99
History of Texas, Smith, Prescott, 123-683947687, 9.75
- Write BookTest to create all books and calculate the charge. The quantity will be in a one-dimensional array as follows.
12 8 3 53 7 23 14 5
6. Using the data array, write method buildInstances that will create instances of books and store them in a one-dimensional array of Book, bookArray. Using the quantity array, write method createCharges that walk through the book array and call calculateCharge for the total charge per book sold. Print in a dialog box the book title, the book isbn, and the total charge for each book and the grand total of all books sold. Format money.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started