Question: You are writing a Java program for a bookstore that has a membership rewards program. This membership program has two versions: a free version and
You are writing a Java program for a bookstore that has a membership rewards program. This membership program has two versions: a free version and a paid version. Both free and paid members receive a certain amount of points when making purchases, and paid members also receive a 10% discount on their total order. Customers who are not a part of the membership program may also make purchases.
When the program begins, ask the user how many books the customer is buying. Then, ask for the total cost of the books. Finally, ask whether the customer is a free member, paid member, or non-member.
After retrieving the total cost of the books, remove 10% from the cost if the customer is a paid member. All customers should have 8.125% in sales tax added to their total (note: For paid members, tax is added after the discount is applied).
Next, determine how many points the customer will receive for this purchase. If the customer is not a member, they receive 0 points. Otherwise, the number of points earned by the customer is based on the following list:
- If 1 book is purchased, all members earn 5 points.
- If 2 books are purchased, all members earn 15 points.
- If 3 books are purchased:
- Paid members earn 50 points
- Free members earn 30 points
- If 4 or more books are purchased
- Paid members earn 100 points
- Free members earn 60 points
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
