Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[C++] Read the Balances.txt text file. Compute the total of all balances and display the total. Display the average balance in addition to the total
[C++]
Read the Balances.txt text file. Compute the total of all balances and display the total.
Display the average balance in addition to the total of all balances. Inside the loop, you will also need to count the number of customer records. After the loop completes and you have displayed the total of all balances, compute the average balance by dividing the total by the customer count. Then display the average balance.
Balances.txt
6853921 Aaker_Charles 410.58 4215534 Abraham_Sally 1550.35 6224649 Abula_Michael 2051.05 8448936 Addams_Brent 1447.23 2883903 Aitken_Charles 1667.32 6752376 Alexander_Lonny 1214.36 5687022 Allen_Steve 1972.93 3564698 Allop_Jose 2106.13 6375372 Austin_JR 1810.01 8736368 Austin_Nellie 1773.69 8445196 Bailey_Michael 2051.70 7218536 Bailey_Michael 2112.13 6681985 Bailey_Robert 261.10 3909086 Baird_Sally 486.85 7685359 Ballard_Gary 1146.19 5221192 Bell_Roger 1751.61 5901163 Balovich_A 1303.41 3865287 Barber_Larry 704.71 7855458 Barber_Sally 1154.01 5543111 Bates_Fred 2132.83 6539446 Bates_Joan_MD 543.21 4353074 Bettencourt_Sam 367.64 6847641 Bettencourt_Jim 1162.16 4969050 Bettencourt_Sue 299.89 3921164 Black_Donald 410.55 3584136 Black_Marcie 1947.86 7893805 Black_Ralph 1156.34 5562645 Blackburn_Randy 1162.80 7263399 Blackburn_Tom 1743.41 4317590 Blackmore_Mark 1758.48 2867385 Bobbit_Larry_MD 1652.36 8374768 Boccone_Richard 1502.79 6287419 Boucher_Victor 2153.55 5975152 Brewer_Daryl 1393.26 8453374 Brewer_Manny 1059.75 7979495 Brewer_Randall 262.83 3625430 Brooks_Kent 1149.42 3402482 Brooks_Paul 1984.94 7212920 Brooks_Richard 1078.90 2697628 Brooks_Sally 564.57 5234130 Brown_Armando 442.26 3556572 Brown_Kelly 1547.74 5276956 Brown_Larry 370.51 7415592 Brown_Richard 381.07 4259635 Brown_Richard 1534.73 6998318 Brown_Robert 235.83 8596337 Brown_Roger 1691.93 8248711 Brown_William 392.31 6622438 Browne_Alice 775.96 3305709 Browne_Richard 276.29 7216627 Browne_Sylvia 317.44 8978821 Brownell_J_R 702.90 3461583 Brownfield_Joe 1963.09 6352036 Burger_Lance 1822.68 3373741 Bush_Keith 1002.30 8636495 Bush_Rachel 1920.78 3379118 Bush_Sandy 379.02 4576897 Campbell_Chuck 602.54 6276226 Cash_Johnny 1603.59 7601760 Clark_Kent 652.97 2596858 Dang_Dong 1342.33 8445875 Dang_Hoang 1680.03 3277222 Dang_Kanh 1639.70 3576746 Dang_Quang 2070.09 8525968 Dang_Trang 1428.60 8911230 Duncan_Ester 1742.63 6654015 Duncan_Jerry 593.47 5864612 Duncan_Kari 882.94 3916771 Duncan_Mark 2177.11 8646711 Duncan_Miranda 458.00 7496177 Duncan_Sam 419.44 7377233 Duncan_William 664.42 8274030 Estrada_David 1322.70 4555540 Estrada_Leo 1204.18 2516725 Estrada_Manuel 305.57 7878014 Estrada_Rene 1449.26 4974554 Estrada_William 1446.78 8737779 Fernandez_Chuck 756.49 4454811 Gallagher_Joe 594.87 2987125 Gallagher_Mary 1867.68 3706133 Gallagher_Suzy 604.82 7978236 Gonzales_Alfred 1042.26 8766414 Gonzales_Tony 654.64 7649692 Gonzales_Joe 2132.70 8748734 Gonzales_Jose 1829.95 4463320 Gonzales_Luis 235.00 6791401 Gonzales_Maria 1593.89 2926086 Gonzales_Pablo 1045.15 8253791 Ha_Dave 1151.03 4314868 Ha_Fong 961.50 7671276 Ha_James 2085.68 2499802 Ha_Kelly 606.28 2344238 Ha_Nguyen 1771.03 5578678 Ha_Sang 432.56 7643057 Hernandez_A 1606.60 2817664 Hernandez_Jose 773.58 2660113 Hendrix_Daniel 220.50 8213456 Houston_Bill 310.27 2338123 Houston_Dan 271.30 7961122 Houston_Jim 930.15 5851526 Houston_John 1039.36 8401540 Howard_Alfred 448.03 8238225 Howard_Mary 880.06 6837553 Howard_Steve 2124.16 2955456 Hunter_Paul 691.99 6397102 Javier_Jose 802.31 3242666 Javier_Luis 432.43 3815865 Javier_Maira 1291.18 6824395 Joshston_Bill 1867.41 2306909 Johnston_Mary 1233.53 2774785 Johnston_Steve 630.04 5347586 Jordan_David 1380.54 4486432 Jordan_Marueen 674.92 2798731 Kelly_Dan 250.29 4248749 Kelly_E 460.02 8898693 Kelly_George_MD 1764.68 4597789 Lambert_Richard 1571.79
1 #include
Step 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