oyalty points are awarded by a company based on the amount a customer spend. Loyalty points can be used immediately with the current transaction or can be accumulated. The number of loyalty points per transaction is calculated as follows: For purchases of R 500.00 or less, 1 loyalty point will be awarded per R 50.00 spent. For purchases of more than R 500.00 the following applies:  For the first R 500.00, 1 loyalty point will be awarded per R 50.00 spent  For the remainder of the amount, 2 loyalty points will be awarded per R50.00 spent. Examples: For purchases of R 460.00, 9 loyalty points will be awarded. For purchases of R 660.00, 10 loyalty points will be awarded for the first R 500.00 and 6 loyalty points for the remaining R 160.00 = 16 loyalty points For purchases of R 1250.00, 10 loyalty points will be awarded for the first R 500.00 and 30 loyalty points for the remaining R 750.00 = 40 loyalty points The monetary value of the loyalty points is calculated as follows: The first 30 loyalty points are worth 25c each. Loyalty points from 30 up to 50 is worth 40c each. Loyalty points above 50 is worth 60c each With each transaction the customer can choose to use their loyalty points in which case the customer will receive the monetary value of the total number of loyalty points and the total will be set to 0. 2 If the total number of loyalty points reaches a total of 50 when a transaction takes place, the customer automatically receives the monetary value of the total number of points. If a total of 50 or more points is reached within 3 transactions, the customer also receives a 5% discount on the current purchase amount. Do the following: Write code  to simulate a number of transactions done by one customer. The user must enter purchase amounts for a number of transactions. Use the value of -1 as purchase amount to quit input.  For each transaction display the number of loyalty points earned with the current transaction, the total number of loyalty points and the monetary value of the total number of loyalty points.  If the total number of points did not reach the value of 50 yet with the current transaction, the user must indicate whether the points will be used or not. If the points are used, the total number of points must be set to 0.  If the total number of points reaches the value of 50 with the current transaction, the user does not have a choice to use the points. The points will automatically be used and the total number of points will be set to 0. A discount must be calculated and displayed if applicable.

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter15: Deterministic Eoq Inventory Models
Section15.7: Multiple-product Eoq Models
Problem 1P
icon
Related questions
Question
100%

Loyalty points are awarded by a company based on the amount a customer spend. Loyalty points can be used
immediately with the current transaction or can be accumulated.


The number of loyalty points per transaction is calculated as follows:
For purchases of R 500.00 or less, 1 loyalty point will be awarded per R 50.00 spent.
For purchases of more than R 500.00 the following applies:
 For the first R 500.00, 1 loyalty point will be awarded per R 50.00 spent
 For the remainder of the amount, 2 loyalty points will be awarded per R50.00 spent.


Examples:
For purchases of R 460.00, 9 loyalty points will be awarded.
For purchases of R 660.00, 10 loyalty points will be awarded for the first R 500.00 and 6 loyalty points for the
remaining R 160.00 = 16 loyalty points
For purchases of R 1250.00, 10 loyalty points will be awarded for the first R 500.00 and 30 loyalty points for the
remaining R 750.00 = 40 loyalty points
The monetary value of the loyalty points is calculated as follows:
The first 30 loyalty points are worth 25c each.
Loyalty points from 30 up to 50 is worth 40c each.
Loyalty points above 50 is worth 60c each

With each transaction the customer can choose to use their loyalty points in which case the customer will receive
the monetary value of the total number of loyalty points and the total will be set to 0.
2
If the total number of loyalty points reaches a total of 50 when a transaction takes place, the customer
automatically receives the monetary value of the total number of points. If a total of 50 or more points is reached
within 3 transactions, the customer also receives a 5% discount on the current purchase amount.


Do the following:
Write code  to simulate a number of transactions done by one customer.
The user must enter purchase amounts for a number of transactions. Use the value of -1 as purchase amount
to quit input.


 For each transaction display the number of loyalty points earned with the current transaction, the total
number of loyalty points and the monetary value of the total number of loyalty points.


 If the total number of points did not reach the value of 50 yet with the current transaction, the user must
indicate whether the points will be used or not. If the points are used, the total number of points must
be set to 0.


 If the total number of points reaches the value of 50 with the current transaction, the user does not have
a choice to use the points. The points will automatically be used and the total number of points will be
set to 0. A discount must be calculated and displayed if applicable.

 

 
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Probability Problems
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L