USE C++ Please Program Specifications: Write a program to search three parallel vectors containing customer credit card debt information. Identify statistics such as the number of customer names that begin with 'S', the number of customers with no debt, and the number of customers that live in a specific state. Step 0. Review the starter code in main(). The number of requested customers is input (integer). A function is called that reads data from a text file and fills three parallel vectors with customer names, state of residence, and amount of credit card debt for each customer. Using a function is a convenient way to fill vectors with hundreds of elements. Functions and reading data from text files are described in other sections of the book. Step 1. Input a debt limit (integer), the first letter of the customer's name (char), and a state abbreviation (string). Note that the number of customers is already input during Step 0. Step 2. Use a loop to process each element of the names and debt vectors to identify the customer with the highest debt. Output a report header, number of customers, and the person's name with the highest debt. Submit for grading to confirm two tests pass. Ex: If the input is: 1000 250 P LA the output is: U.S. Report Customers: 1000 Highest debt: Sullivan Step 3. Use a loop to process each element of the names vector to count all customer names that begin with the specified letter. Ex: How many customer names begin with 'B' or 'L'? Output the number of customer names that start with the specified letter. Submit for grading to confirm four tests pass. Ex: If the input is: 1000 250 P TX the output is: U.S. Report Customers: 1000 Highest debt: Sullivan Customer names that start with 'P': 57 Step 4. Use a loop to process each element of the names and debt vectors to count the number of customers that have debt higher than the specified debt limit and the number of customers that have no debt. Output all results. Submit for grading to confirm six tests pass. Ex: If the input is: 2000 250 P TX the output is: U.S. Report Customers: 2000 Highest debt: Sullivan Customer names that start with 'P': 111 Customers with debt over $250: 1562 Customers debt free: 438 Step 5. Repeat steps 2 - 4 for all customers living in the specified state. Output all results including a header for the state report. Submit for grading to confirm all tests pass. Ex: If the input is: 8000 8000 A CA the output is: U.S. Report Customers: 8000 Highest debt: Anderson Customer names that start with 'A': 261 Customers with debt over $8000: 2480 Customers debt free: 1697   CA Report Customers: 851 Highest debt: Duenas Customer names that start with 'A': 38 Customers with debt over $8000: 268 Customers debt free: 176

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

USE C++ Please

Program Specifications: Write a program to search three parallel vectors containing customer credit card debt information. Identify statistics such as the number of customer names that begin with 'S', the number of customers with no debt, and the number of customers that live in a specific state.

Step 0. Review the starter code in main(). The number of requested customers is input (integer). A function is called that reads data from a text file and fills three parallel vectors with customer names, state of residence, and amount of credit card debt for each customer. Using a function is a convenient way to fill vectors with hundreds of elements. Functions and reading data from text files are described in other sections of the book.

Step 1. Input a debt limit (integer), the first letter of the customer's name (char), and a state abbreviation (string). Note that the number of customers is already input during Step 0.

Step 2. Use a loop to process each element of the names and debt vectors to identify the customer with the highest debt. Output a report header, number of customers, and the person's name with the highest debt. Submit for grading to confirm two tests pass.

Ex: If the input is:

1000 250 P LA

the output is:

U.S. Report

Customers: 1000

Highest debt: Sullivan

Step 3. Use a loop to process each element of the names vector to count all customer names that begin with the specified letter. Ex: How many customer names begin with 'B' or 'L'? Output the number of customer names that start with the specified letter. Submit for grading to confirm four tests pass.

Ex: If the input is:

1000 250 P TX

the output is:

U.S. Report

Customers: 1000

Highest debt: Sullivan

Customer names that start with 'P': 57

Step 4. Use a loop to process each element of the names and debt vectors to count the number of customers that have debt higher than the specified debt limit and the number of customers that have no debt. Output all results. Submit for grading to confirm six tests pass.

Ex: If the input is:

2000 250 P TX

the output is:

U.S. Report

Customers: 2000

Highest debt: Sullivan

Customer names that start with 'P': 111

Customers with debt over $250: 1562

Customers debt free: 438

Step 5. Repeat steps 2 - 4 for all customers living in the specified state. Output all results including a header for the state report. Submit for grading to confirm all tests pass.

Ex: If the input is:

8000 8000 A CA

the output is:

U.S. Report

Customers: 8000

Highest debt: Anderson

Customer names that start with 'A': 261

Customers with debt over $8000: 2480

Customers debt free: 1697

 

CA Report

Customers: 851

Highest debt: Duenas

Customer names that start with 'A': 38

Customers with debt over $8000: 268

Customers debt free: 176

main.cpp
1 #include <iostream>
2 #include <fstream>
3 #include <string>
#include <vector>
4
5 using namespace std;
6
7
8
9
10
11
12
13
14
15
16
17
18
19
50 %
// Read customer information from external file
// Make no changes to the following code
void ReadCustomerData(vector<string>& names, vector<string>& states, vector<double>& debt) {
ifstream inFS;
// Read all data from file into three parallel vectors
try {
inFS.open("CustomerData.csv");
for (long unsigned index = 0; indexnames.size(); ++index) {
inFS >> names.at (index); // last name
inFS >> states.at(index); // state of residence
inFS >> debt.at (index); // amount of debt
Transcribed Image Text:main.cpp 1 #include <iostream> 2 #include <fstream> 3 #include <string> #include <vector> 4 5 using namespace std; 6 7 8 9 10 11 12 13 14 15 16 17 18 19 50 % // Read customer information from external file // Make no changes to the following code void ReadCustomerData(vector<string>& names, vector<string>& states, vector<double>& debt) { ifstream inFS; // Read all data from file into three parallel vectors try { inFS.open("CustomerData.csv"); for (long unsigned index = 0; indexnames.size(); ++index) { inFS >> names.at (index); // last name inFS >> states.at(index); // state of residence inFS >> debt.at (index); // amount of debt
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education