# Help with one dimensional

December 13, 2010 at 19:33:01
Specs: Windows 7
 Hey everyone, I'm not very good at programming and I have a final tomorrow D: ~ The teacher is asking us to use a one-dimensional array to solve the following problem: A company pays its sales people on a commission basis. The sales people receive \$200 per week, plus 9% of their gross sales for that week. For example, a sales person who grosses \$5000 in sales in a week received \$200 plus 9% of \$5000, or a total of \$650. Write a program (using an array of counters) that reads the data file and displays how many of the salespeople earned salaries in each of the following ranges (assume that each salespersonâ€™s salary is truncated to an integer amount) Whats really thrown me off is that he says: Read a disk file named SalesResult.txt that contains a list of sales amounts. See a sample of the file below. To pass the exam, the data file will be different from the one shown below. Sample data file438581583684115047103995831160272853632397531391165I have no idea what he means by this. I only see the instructor once a week and I had no time to ask him what was going on so I'm really lost. If any of you could help me with what he wants, and maybe some tips or outline I would be extremely grateful!! Thanks TTuTT

See More: Help with one dimensional

#1
December 13, 2010 at 21:47:03
 Pretty much what it sounds like; the program's input will come from a file called "SalesResult.txt". For testing, you might want to make a "SalesResult.txt" yourself.How To Ask Questions The Smart Way

Report •

#2
December 14, 2010 at 11:12:17
 loop through the file computing each data item based on \$200 + 0.09 * data item, and test the result against your ranges. Whatever range the result falls under, increment that index in the "counter" array.

Report •

Related Solutions