Create a program to produce a sales report


Assignment:

Q: Write a program to produce a sales report similar to the one below that indicates individual percentage contribution by each employee. The program must allow the user to enter a user id number and sales amount for up to 10 employees, but must allow fewer to be entered if desired, stopping input when the user enters the value zero for an employee id number.

Emp.ID $ Sales % Sales
-------------------------
12345 $3000.00 30%
24681 $1000.00 10%
35791 $4000.00 40%
48484 $2000.00 20%
-------------------------
Total: $10000.00 100%

Your output window should be similar to the following:

Employee ID Number (0 when done)? 12345
Sales volume for this period? $ 3000.00

Employee ID Number (0 when done)? 24681
Sales volume for this period? $ 1000.00

Employee ID Number (0 when done)? 35791
Sales volume for this period? $ 4000.00

Employee ID Number (0 when done)? 48484
Sales volume for this period? $ 2000.00

Employee ID Number (0 when done)? 0

User input complete.

EMPLOYEE SALES WITH PERCENTAGE BREAKDOWN

Emp.ID $ Sales % Sales
-------------------------
12345 $3000.00 30%
24681 $1000.00 10%
35791 $4000.00 40%
48484 $2000.00 20%
-------------------------
Total: $10000.00 100%

Press any key to continue...

You will need to declare 3 arrays. The first array will hold the employee ID. The second array will hold the amount of sales for that employee. Finally, the third array will hold the percentage of sales for each employee.

The percentage sales for each employee should be the last thing to be calculated. You have to read the ID and the sales amount first, and as you do that, you accumulate the sales of each employee to a total. To get the percentage of each employee's sales, use the following formula:

Percentage = 100 * Sales Amount/Total Sales

As you calculate the percentage, add the percentage to a total as well, so that you can print it at the bottom of your sales report table.

Solution Preview :

Prepared by a verified Expert
Database Management System: Create a program to produce a sales report
Reference No:- TGS01936338

Now Priced at $25 (50% Discount)

Recommended (96%)

Rated (4.8/5)