147k views
4 votes
Python please,

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

This program is designed for incremental development, complete each step.

Step 0. Review the starter code in the main portion of the program. The number of requested customers is input (integer). Function read_customer_data() is called that reads data from a text file and fills three parallel lists with customer names, state of residence, and amount of credit card debt for each customer. Using a function is a convenient way to fill lists 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), search phrase (string), and state abbreviation (string). Note that the number of customers to consider is already input during Step 0.

Step 2 (2 pts). Use a loop to process each element of the names and debt lists 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 input is:

1000

250

P

LA



the output is:

U.S. Report

Customers: 1000

Highest debt: Sullivan



Step 3 (2 pts). Use a loop to process each element of the names list to count all customer names that begin with the specified search phrase. Ex: How many customer names begin with "Bre" or "L"? Hint: Use the startswith() function. Output the number of customer names that start with the search phrase. Submit for grading to confirm four tests pass.

Ex: If input is:

5000

8000

Mor

CA



the output is:

U.S. Report

Customers: 5000

Highest debt: Smith

Customer names that start with "Mor": 45



Step 4 (2 pts). Use a loop to process each element of the names and debt lists 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 input is:

1500

1000

R

WY

1 Answer

2 votes

Final answer:

The program requires incrementally developing code to search and analyze data from three parallel lists of customer credit card debt information.

Step-by-step explanation:

Step 0:

Review the starter code and input the number of requested customers.

Step 1:

Input the debt limit, search phrase, and state abbreviation.

Step 2:

Use a loop to find the customer with the highest debt and output the result.

Step 3:

Use a loop to count the number of customer names that begin with the search phrase and output the result.

Step 4:

Use a loop to count the number of customers with debt higher than the specified limit and the number of customers with no debt and output the results.

User Abdelalim Hassouna
by
7.9k points

No related questions found