Step 4 (2 pts). Use a loop to process each element of the names and debt arrays 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:2000 250 P TXthe output is:U.S. ReportCustomers: 2000Highest debt: SullivanCustomer names that start with 'P': 111Customers with debt over $250: 1562Customers debt free: 438
Question
Step 4 (2 pts). Use a loop to process each element of the names and debt arrays 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:2000 250 P TXthe output is:U.S. ReportCustomers: 2000Highest debt: SullivanCustomer names that start with 'P': 111Customers with debt over $250: 1562Customers debt free: 438
Solution
The question seems to be asking for a solution in a programming language, but it doesn't specify which one. However, I'll provide a solution in Python, which is a common language for this type of task.
Here's a step-by-step guide on how to solve this:
-
First, you need to have two arrays:
namesanddebt. These should be filled with the data of the customers. Thenamesarray should contain the names of the customers and thedebtarray should contain the corresponding debt of each customer. -
Initialize two counters to zero:
debt_higher_than_limitanddebt_free. -
Use a for loop to iterate over the
debtarray. For each element in thedebtarray, check if it's higher than the specified debt limit. If it is, increment thedebt_higher_than_limitcounter. If it's zero, increment thedebt_freecounter. -
After the loop, print the results.
Here's a Python code snippet that implements the above steps:
names = [...] # fill with customer names
debt = [...] # fill with corresponding customer debt
debt_limit = 250
debt_higher_than_limit = 0
debt_free = 0
for i in range(len(debt)):
if debt[i] > debt_limit:
debt_higher_than_limit += 1
elif debt[i] == 0:
debt_free += 1
print("Customers with debt over $", debt_limit, ": ", debt_higher_than_limit)
print("Customers debt free: ", debt_free)
Please replace the names and debt arrays with your actual data. Also, adjust the debt_limit variable to the value you want to check against.
Similar Questions
Step 3 (2 pts). Use a loop to process each element of the names array 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 input is:1000 250 P TXthe output is:U.S. ReportCustomers: 1000Highest debt: SullivanCustomer names that start with 'P': 57
Step 5 (4 pts). 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 input is:8000 8000 A CAthe output is:U.S. ReportCustomers: 8000Highest debt: AndersonCustomer names that start with 'A': 261Customers with debt over $8000: 2480Customers debt free: 1697CA ReportCustomers: 851Highest debt: DuenasCustomer names that start with 'A': 38Customers with debt over $8000: 268Customers debt free: 176
From the following particulars extracted from the books of Ashok & Co. Ltd., compute the followingratios and comment:(a) Current ratio, (b) Acid Test Ratio, (c) Stock-Turnover Ratio, (d) Debtors Turnover Ratio, (e) Creditors'Turnover Ratio, and Average Debt Collection period.41-1-2002 31-12-2002Rs. Rs.Bills Receivable 30,000 60,000Bills Payable 60,000 30,000Sundry Debtors 1,20,000 1,50,000Sundry Creditors 75,000 1,05,000Stock-in-trade 96,000 1,44,000Additional information:(a) On 31-12-2002, there were assets: Building Rs. 2,00,000, Cash Rs. 1,20,000 and Cash at Bank Rs.96,000.(b) Cash purchases Rs. 1,38,000 and Purchases Returns were Rs. 18,000.(c) Cash sales Rs. 1,50,000 and Sales returns were Rs. 6,000.Rate of gross profit 25% on sales and actual gross profit was Rs. 1,50,000
Select all that applyWhen accounting for accounts receivable and bad debts, the objectives are to ______. (Check all that apply.)Multiple select question.match the cost of bad debts to the accounting period in which the related credit sales are madereport accounts receivable at the net realizable value which equals accounts receivable less the amount the company does not expect to collect.increase both accounts receivable and net income by the amount of credit sales that are unlikely to be collected as cash
Write a query to display the number of bills having fine_amount. Give an alias name as 'count_of_bills_with_fine'.Note:1. Display only the number of bills having the fine_amount from bill table. (If fine_amount is greater than 0 then it indicates that bill got fine_amount.)2. Specify the alias name without any mistake.3. Specify condition on fine_amount column of bill table.3. Compare your executed result with the sample output given below.Sample output:
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.