QUESTION n Write a C++ program to do the following Do not use global variables A gyn is running a rewards program for th
Posted: Fri May 20, 2022 1:46 pm
QUESTION n Write a C++ program to do the following Do not use global variables A gyn 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, T for regular customer, and n for new customer. Sample input could be AJ328 310 P MT201 45 SB073 110 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, 151 of the points for a regular customer, and 111 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, comsiting of one line per customer, showing their customer ID and their cash reward. Sample Output AJ328 $77.50 MT201 $6.75 S8073 S12.10 Your program should be formatted to 2 decimal places Attach File Browse locales Browse Content Collection