0% found this document useful (0 votes)
10 views2 pages

Sales Collection

The document outlines a sales collection application that gathers data on up to 4 salespeople and the quantities of 3 products they sold. It details the steps for prompting user input, storing the data in an array, and calculating total sales amounts for each person and overall. The products and their prices are specified, along with an example of how the input and output should be structured.

Uploaded by

mhuang49
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Sales Collection

The document outlines a sales collection application that gathers data on up to 4 salespeople and the quantities of 3 products they sold. It details the steps for prompting user input, storing the data in an array, and calculating total sales amounts for each person and overall. The products and their prices are specified, along with an example of how the input and output should be structured.

Uploaded by

mhuang49
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Scope: Arrays and Loops

Sales collection
We’ll be collecting the names of up to 4 sales people.
For each person, we’ll collect how many of 3 different products they sold.
Determine the total $ amount sold by each person and the overall $ amount.

Application flow.
1. Prompt for the number of sales people.
2. Collect the names of them into an array.
3. For each person, prompt for each product (see below) and collect how many of those
were sold by that sales person. See below matrix for how to store it.
4. Calculate totals (see table below) and print that out.

Product Price

Printer $100

Paper $12

Ink $29

Person 1 Person 2 Person 3 Person 4

Printer 2 3 4 5

Paper 5 4 3 5

Ink 12 1 2 4

Example:
How many sales people? 4
Name of sales person 1: Bob
Name of sales person 2: Ann
Name of sales person 3: Kat
Name of sales person 4: Tim

How many printers sold by Bob? 2


How much paper sold by Bob? 5
How much ink sold by Bob? 12

… same for other 3 sales people


Bob sold $608
Ann sold …

Total sold ..

You might also like