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 po

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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:

  1. 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.
  2. 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)
  3. 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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education