Question: ISM 3230 ISM6148 Assist creating two intellij .java IDE classes. The driver class BookRankings and sub class AudioBooks Each book will have a name, genre,

ISM 3230 ISM6148

Assist creating two intellij .java IDE classes. The driver class BookRankings and sub class AudioBooks Each book will have a name, genre, number of copies sold, and percentage sold. Also determine the total number of books added, and the total number of all books sold. AudiotBooks will have following parameters and are all private: 1. Name 2. Number of copies sold 3. Genre 4. Percentage of books sold 5. Total Number of books added, as a static variable 6. Total Number of books sold for all books, as a static variable

AudioBooks must have these user-defined Non-Static methods

1. Method to get total number of books added 2. Method to get total number of books sold for all books 3. Methods for all private parameters (getters and setters) 4. However, dont create methods for setting number of books added or total number of book sold

AudioBooks must this Overloaded Constructor will accept only, the name and number of copies sold as static parameters, genre set using method. BookRanking can have as many parameters as needed

BookRanking will have method main which will have this non-static object: AudioBooks[] books = new AudioBooks[5];

BookRanking must have these user-defined Static methods 1. Method to create an array of books - All user inputs must be done in this method 2. Method to determine the percentage sold and it add to the array 3. Method to print the results - results retrieved via loop and getter methods.

[ Preffered template for the print method: ]

private static void printResults(An array of AudioBooks) { String sStars = String.format("%73s", " ").replace(' ', '*'); System.out.printf("%n%s", sStars); System.out.printf("%n| %-20s | %-20s | %-12s | %-12s", "Name ","Genre", "Books Sold", "Percentage"); For loop System.out.printf("%n| %-20s | %-20s | %-12d | %-12.2f", Value for Name, Value for Genre, Value for Copies sold, Value for Percent Sold ); End of For Loop System.out.printf("%n%s%n", sStars); System.out.println("The total number of books: " + Value for number of books); System.out.println("The total number of books sold: " + Value for total number of books sold); } //conclusion script

/* Much appreciated, here's sample data provided:  // [text-prompt]  Please input book title:  Enter the Genre:  Number of copies sold: // [data inputed]  [Book1] Rings of the Lords RingsGenre 305 sold  [Book2] Hungry Games DystopiaGenre 211 sold  [Book3] Magic School SpellsGenre 389 sold  [Book4] Thrones and Games DragonsGenre 183 sold  [Book5] The Moving Tower PortalsGenre 266 sold // [output displayed]   *************************************************************************  | Name | Genre | Books Sold | Percentage   | Rings of the Lords | Rings | 305 | 0.19  | Hungry Games | Dystopia | 211 | 0.13  | Magic School | Spells | 389 | 0.24  | Thrones and Games | Dragons | 183 | 0.11  | The Moving Tower | Portals | 266 | 0.16  *************************************************************************  The total number of books: 5  The total number of books sold: 1637 */ 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!