Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

**Problem Narrative:**

In a sales organization, determining commissions accurately is crucial for motivating sales staff
and ensuring fairness. However, manual calculation of commissions for each salesperson can
be time-consuming and prone to errors. To address this, an algorithm needs to be developed
that automates the commission calculation process. The algorithm should accept the names of
sales staff members along with their total sales for the month and calculate their commission at
a rate of 5% of their total sales. Finally, it should display the name, total sales, and commission
of the staff member with the highest commission.

**Algorithm Pseudo-code:**

```
1. Start
2. Initialize variables:
highest_commission = 0
highest_commission_name = ""
highest_commission_sales = 0
3. For each sales staff member:
a. Input name
b. Input total_sales
c. commission = total_sales * 0.05
d. If commission > highest_commission:
i. highest_commission = commission
ii. highest_commission_name = name
iii. highest_commission_sales = total_sales
4. Display highest_commission_name, highest_commission_sales, highest_commission
5. End
```

**Trace Table:**

| Name | Total Sales | Commission | Output |


|---------------|---------------|---------------|--------------------------|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |

**Test Data:**

1. Employee 1:
- Name: John
- Total Sales: $5000
2. Employee 2:
- Name: Emily
- Total Sales: $7000
3. Employee 3:
- Name: Alex
- Total Sales: $6000
4. Employee 4:
- Name: Sarah
- Total Sales: $8000
5. Employee 5:
- Name: Michael
- Total Sales: $5500

You might also like