Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write code in Java The goal of this coding exercise is to create two classes BookstoreBook and LibraryBook. Both classes have these attributes: author: String
Write code in Java
The goal of this coding exercise is to create two classes BookstoreBook and LibraryBook. Both classes have these attributes: author: String tiltle: String isbn : String The BookstoreBook has an additional data member to store the price of the book, and whether the book is on sale or not. If a bookstore book is on sale, we need to add the reduction percentage (like 20% off...etc). For a LibraryBook, we add the call number (that tells you where the book is in the library) as a string. The call number is automatically generated by the following procedure: The call number is a string with the format xx.yyy.c, where xx is the floor number that is randomly assigned (our library has 99 floors), yyy are the first three letters of the author's name (we assume that all names are at least three letters long), and c is the last character of the isbn. In each of the classes, add the setters, the getters, at least three constructors (of your choosing) and override the tostring method (see sample run below). Also, add a static variable is each of the classes to keep track of the number of books objects being created in your program. - Your code should handle up to 100 bookstore books and up to 200 library books. Use arrays to store your objectsStep 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