Write a C++ program to do the following. Do not use global
variables.
A gym is running a rewards program for their customers, and the
reward is a cash amount for meeting exercise goals. Assume that the
customer information is stored in an input file (as shown below)
called customers.txt. Each customer’s data is
contained on one line, consisting of the customer ID (5
characters), the total points earned by the customer for meeting
exercise goals, and the customer type represented by the
codes: p for preferred
customer, r for regular customer,
and n for new customer.
Sample input could be:
AJ328 310 p
MT201 45 r
SB073 110 n
The gym rewards the customers by providing a cash equivalent for
a percentage of their goal points. The reward amount is 25% of the
customer’s points for a preferred customer, 15% of the points for a
regular customer, and 11% of the points for new customers. Your
program should calculate how much reward each customer is eligible
for and output the result to an output file
called rewardAmount.txt, consiting of one
line per customer, showing their Customer ID and their cash
reward.
Sample Output
AJ328 $77.50
MT201 $6.75
SB073 $12.10
Your program should be formatted to 2 decimal places
Write a C++ program to do the following. Do not use global variables. A gym is running a rewards program for their cust
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am