Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Please void printCustomersData(const int id[], const string first[], const string last[, const double savings_Account], cons Output of option 2 t double checking Accountll, int
C++ Please
void printCustomersData(const int id[], const string first[], const string last[, const double savings_Account], cons Output of option 2 t double checking Accountll, int size); Print all custoners data Print nanes and IDs Print accounts total Enter q/Q to quit nter your choice, or "q to quit: 1 FIrst Savings Account 810.2 1ee 33.9 1938.82 932 Checking Account Last Smith Stanely 101.1 394.9 7483.77 ack Dandel Hackson Thonas Elu 334.3 Carol ina Nael Carol Jack Lion Snith Carlton 34.9 8843.2 3994.0 77.S 88.9 2343.3 8433.04 Print all custoners data Print nanes and IDs Print accounts total Enter q/O to quit nter your choice, orq to quit: Note that the "switch" statement must be inside a "while" loop, which means that after each option selection, the options will be printed again. The function "printNames" prints the ID, first, and last name of each customer (the output should also be as a table). This function accepts four parameters (three arrays and the size). See the function prototype bellow 2. void printNames(const int id[], const string first[], const string last, int size); Print all customers data Print nanes and IDs Print accounts total Enter q/Q to quit nter your choice, or q to quit:2 First Homer Jack Daniel Hackson Last Smith Stanely Thomas Elu Carol Jefferson Lion Smith Carlton Tina Hael Carol 00 Jack Print all customers data Print nanes and IDs Print accounts total Enter q/0 to quit nter your choice, orq to quit: 3. The function "printTotal" that prints all customers IDs, the balance of the savings account, the balance of the checking account, and the total balance for each customer (savings balance checking balance) As mentioned before, the output has to be in a table. This function accepts four parameters (three arrays and the size). This is the function prototype void printTotal(const int id[], const double savings_Account[], const double checking_Account], int size); Print all customers data Print nanes and IDs Print accounts total Enter q/o to quit nter your choice, or q' to quit: 3 D Savings Account Checking Account Total 810.2 1ee 333.9 930.82 932 101.1 1394.9 7483.77 4473.2 2334.3 911.3 1494.9 7817.67 6403.22 3266.3 34-9 8843.2 3994.09 77.5 88.9 2343.3 8433.04 112.4 8932-1 6337.39 8532.04 0 99 Print all custoners data Print nanes and ID Print accounts total Enter q/Q to quit nter your choice, orq to quit: - If the user entered something not in the options such as the letter 'a', the application should not be terminated. Instead, the application should print a message that tells the user that his/her input was incorrect, then the options should be displayed again, and the application should ask the user to enter another option. Print all customers data Print nanes and IDs Print accounts total Enter q/Q to quit nter your choice, or q' to quit: a rong input. Try again... Print all customers data Print nanes and IDs Print accounts total Enter q/Q to quit nter your choice, or q' to quit: - As mentioned before, the options will be printed after each selection. Even when the user enters an invalid value. The only way to terminate the program is to enter 'q' or 'Q which is the fourth option. . Print all customers data 2. Print names and IDs Print accounts total .Enter q/Q to quit Enter your choice, or q to quit: q Thanks for using my program. Goodbye!! ress any key to continue Control Flow: The application should start by reading the data from the input file. Then create a "while" loop to repeat the options after each selection. Within the "while" loop, create your "switch" statement that contains the different options. Each case/option inside the "switch" statement should execute a function call Hints: All arrays must be passed as constant array parameters, since all functions will print these arrays without changing their items value. Create a constant variable to use it as the size of the arrays. Create an "if" statement to check if the file reading process went well. You can use many expressions such as: (fin or (fin.failO), etc. 1. 2. 3. 4. Do not forget the "break" statement after each case inside the "switch" statement 5. Use the function "setw(number)" that helps you to print the data in a shape of table. This function sets the number of spaces for each output. The function is in theStep 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