The student is allowed to rent 3 books for free: one e-book and 2 hard copy books. Once limit is reached, a thank you message will be displayed as shown below. If hardcopy book name starts with capital f (e.g. F), it's known to be fiction which is given price 40 SAR by default. Use only noargs constructors in creating objects in the Test class.
Sample Run:
Welcome to Alfaisal Bookstore! You are allowed 3 rentals Which e-book you want to rent? Hello pdf size is 5 MB You are allowed 2 rentals Which hardcopy book you want to rent? (F before book name indicates Fiction): FHello renting E books cost: 40.0 SAR You are allowed 1 rentals Which hardcopy book you want to rent? (F before book name indicates Fiction): FHi renting E books cost: 40.0 SAR Thanks for trying us.. You reached the limit of renting
If 3rd input was empty, handle any possible exception: (Bonus 2%)
Which hardcopy book you want to rent? (F before book name indicates Fiction): Warning.. Invalid Input
Build a java program that has the following hierarchy of classes:
Notes:
- Pdf side is randomly generated number between 0 and 1000
- Hardcopy book name starting with "F" uses price method in fiction class (40 per item)
- Rental limit is decremented every time you rent a book
Solved By Verified
Study Co-Pilot All Study Co-Pilots are evaluated by Gotit Pro as an expert in their subject area.
Instant
Download
Student review: (3 ratings) 3 out of 3 people found this solution helpful.