Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use in c++ Please use in c++ Electronics store Discount The assignment problem: You are asked to develop an application that prints a receipt
Please use in c++
Please use in c++
Electronics store Discount The assignment problem: You are asked to develop an application that prints a receipt for customers after store 40% discount. In this program you need to read a file of customers data into different arrays, pass these arrays to functions as (array parameter), calculate the total discount for each customer, then print some information. The input file "input.txt" contains the following information (Transaction ID, first name, last name, and total before discount). You have to store these different columns in different arrays where each index represents a customer data. Preliminaries 1. We will consider the file contains 10 rows maximum. So all your arrays size must be at least 10. 2. Since the size of all the arrays is 10, so it is better to create a constant variable with the value 10 than hard coding the arrays size. Hint: You will need to pass this constant to your functions later on as your array size to limit your loops iterations 3. Create four different arrays with different types based on the data in the file. 4. Create an "ifstream" object to read the data from the input file 5. Read and store the data from the input file in your arrays using a single "for" loop. 6. Create a "switch" statement with four options and the output should be generated based on the chose option. Check the options below: 1. Print all customers data 2. Print names and Transaction ID 3. Print total before and after discount applied 4. Enter q/Q to quit Enter your choice or 'q' to quit: Required functions: . A function "printCustomersData" should be called when the user chooses the first option. This function is of type void (it does not return anything). "printCustomersData" function accepts five parametersStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started