Question: THIS IS A JAVA PROGRAM A small bookstore has implemented a membership loyalty program. Members pay $15 per year to belong. In return, members receive
THIS IS A JAVA PROGRAM
A small bookstore has implemented a membership loyalty program. Members pay $15 per year to belong. In return, members receive a 5% discount on all books purchased. In addition, when they have purchased 10 books, the (undiscounted) price of the last 10 books is averaged, and the average is applied as a discount toward the cost of the 11th book, up to the full price of the 11th book. If the discount is greater than the price of the 11th book, then the 11th book is free, but there is no cash refund. (If the average of the last 10 books bought is $20, and the 11th book costs $17, then the book is free but there is no refund of the other $3. If the 11th book costs $25, then the discounted price is $5.) After the discount is applied, the information about the previous 10 books is cleared and the process starts over. The discounted price of the 11th book is not counted as part of the next set of 10.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
