A menu driven program is required that will allow the user either produce a sales report on the console, search a sales file do some data analysis. The program will take its input from the comma delimited sequential file "sales.dat" with the record structure outlined below.
SALES.TXT record structure
Field Name
| Type
|
salesPersonNumber
| Integer
|
salesPersonName
| String
|
totalSales
| Double
|
This is an example of its contents:
1,Pat Ryan,280
2,Mary Smith,300
3,Tom Lynch,20
Menu FormatMenu1. Sales Report2. Search for a Salesperson3. Sale Analysis4. ExitThe user shall be able to create report, search and do sale analysis as often as they like. The program will terminate when exit is selected.
Sales ReportThe report will have the format and contents as outlined below.
For each salesperson your program will calculate the commission due using the criteria in Table 1.
Table 1
Sale amount
| Commission |
Less than 1000
| 5%
|
Between 1000 and 1999
| 10%
|
Between 2000 and 2999
| 15%
|
Greater than 2999
| 20%
|
Example report for the sample data file
Sales Report
Salesperson number Name Sales commission
1 P.R 280.00 14.00
2 M.S. 300.00 15.00
3 T.L 20.00 1.00
Total Sales €600.00
Average Sales €200.00
Total Commission €30.00
Average Commission €10.00
Top SalesPerson 2
End-of-Report
SearchAllow the user enter a player number, the program will then search the file, and display the players name, and the score for chosen player. If the player is not found display a message stating "No match found".
Example dialogue
Enter Salesperson Number: 2
Name : Mary Smith
Sales : 300
Sales AnalysisA report showing the number of salespeople that sell in the above ranges is required. Use an array to store the number in each range.
Range Number in this range0-399 3400-599 0600-699 0700-999 01000 and over 0