Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are writing a program for a bookstore that has a membership rewards program. This membership program has two versions: a free version and a

You are writing a 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 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 receive no rewards.

Have your program run in a continuous while loop until the user decides to quit. Create a variable before the while loop called grand_total, initialized to 0. Each time a sale is entered, you will add the total to that variable. At the start of each loop iteration, the user has three options:

Enter a new customer sale into the system.

Ask how many books the customer is buying.

Ask for the subtotal cost of the books, before tax.

Ask whether the customer is a free member, paid member, or non-member.

Calculate 9.25% of the subtotal cost to be the amount for taxes and add that amount to the subtotal to calculate the final cost.

If the customer is a paid member, remove 10% of the subtotal cost from the final cost. (Note: The tax amount is not discounted)

Add the final cost to the grand_total variable.

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

Display the following, one per row: # books the customer is purchasing, the subtotal, the tax amount, the final cost, the amount saved (only if they are a paid member, otherwise do not print this row), and points received for this purchase. Make sure to format this information nicely.

See how much money the store has made today.

Print out how much money the store has made today (by printing the grand_total variable)

Quit the program.

Exit out of the while loop at this point. Before closing the program, print out how much money the store made today

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

More Books

Students also viewed these Databases questions

Question

c. Equal increases in aggregate demand and aggregate supply.

Answered: 1 week ago

Question

=+4. What is the purpose of a sandbox on a wiki? [LO-3]

Answered: 1 week ago