Question
In this exercise, we will create two parallel arrays, populate them (using a loop) and then display the results. Create two 10 element lists. The
In this exercise, we will create two parallel arrays, populate them (using a loop) and then display the results.
Create two 10 element lists. The first list is intended to contain customer names. The other list will contain the amount each customer purchased during a set period of time.
You will populate both lists with a single loop. In each iteration of the loop, the user is asked for a name and a dollar amount. Those values are assigned to incrementing elements of the list.
So in the first run of the loop, you will assign a name to the first element of one list, and a dollar amount to the first element of the second list. In the second run of the loop, you assign a name to the second element of one list, and a dollar amount to the second element of the second list.
When you are done, print a report that contains the following -- each customer's name and how much they spent. The total of all cash spent, the average of all cash spent, the largest amount spent, and the least amount spent.
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