Question: FictionBook Ranking You are tasked with creating a program for adding Fiction Books library ranking. Each book will have a name, genre, number of copies
FictionBook Ranking
You are tasked with creating a program for adding Fiction Books library ranking. Each book will
have a name, genre, number of copies sold, and percentage sold. You will also determine the total
number of books added and the total number of all books sold.
Requirements
Create two Classes, a driver class called BookRanking, and a class FictionBook
FictionBook will have following parameters and are all private:
Name
Number of copies sold
Genre
Percentage of books sold
Total Number of books added, it must be a static variable
Total Number of books sold for all books, it must be a static variable
FictionBook must have these userdefined NonStatic methods
Method to get total number of books added
Method to get total number of books sold for all books
Methods for all private parameters getters and setters
Dont create methods for setting number of books added or total number of book sold
FictionBook must this Overloaded Constructor
It will accept only, the name and number of copies sold as parameters.
Hint, you will need to have the static parameters here
Hint, the genre will be set using a method
BookRanking can have as many parameters as needed
BookRanking will have method main which will have this nonstatic object:
FictionBook books new FictionBook;
BookRanking must have these userdefined Static methods
Method to create an array of books All user inputs must be done in this method
Method to determine the percentage sold and it add to the array
Method to print the results results retrieved via loop and getter methods.
Use this template for the print method:
private static void printResultsAn array of FictionBook
String sStars String.formatsreplace;
System.out.printfns sStars;
System.out.printfns s s s "Name "Genre", "Books
Sold", "Percentage";
For loop
System.out.printfns s d f Value for Name, Value
for Genre, Value for Copies sold, Value for Percent Sold ;
End of For Loop
System.out.printfnsn sStars;
System.out.printlnThe total number of books: Value for number of books;
System.out.printlnThe total number of books sold: Value for total number of
books sold;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
