Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

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 the library. Do not forget to write a proper algorithm at the beginning of your code. Write some comments that help the reader to understand the purpose of each loop and function. Inside functions, write preconditions and postconditions. 6. 7. 8. Save the whole project and zip it before uploading it to Canvas. (Do not submit only the cpp' file and do not copy and paste your code to a .txt' file or Word file Submission: Zip up your entire project folder and submit the zip file to Canvas by the deadline. 10 Homer Smith 810.2 101.10 20 Jack Stanely 100.0 1394.90 30 Daniel Hackson 333.90 7483.77 40 Sara Thomson 1930.02 4473.20 50 Thomas Elu 932.0 2334.30 60 Sam Carol 33.0 0.0 70 Tina Jefferson 334.90 777.5 80 Wael Lion 8843.2 88.90 90 Carol Smith 3994.09 2343.30 100 Jack Carlton 99.0 8433.04

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions