Purchase Solution

Program to produce a sales report

Not what you're looking for?

Ask Custom Question

I need to 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
-------------------------
p12345 $3000.00 30%
24681 $1000.00 10%
35791 $4000.00 40%
48484 $2000.00 20%
-------------------------
Total: $10000.00 100%

My 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...

I 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

I need to 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.

P.S. How do you make it where you can view it offline.

Purchase this Solution

Solution Summary

Program to produce a sales report is crafted.

Purchase this Solution


Free BrainMass Quizzes
C++ Operators

This quiz tests a student's knowledge about C++ operators.

Javscript Basics

Quiz on basics of javascript programming language.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.