Professional Documents
Culture Documents
It Sba
It Sba
HIGHEST COMMISSION=0 FOR C = 1 TO 4 DO PRINT Enter name of sales staff member and there total sales for the month READ STAFFNAME, TOTALSALE COMMISSION = TOTALSALE * 3/100 IF COMMISSION > HIGHESTCOMMISSION THEN HIGHESTCOMMISSION = COMMISSION HIGHESTEMPLOYEE = STAFFNAME MOSTSALES = TOTALSALE END IF END FOR PRINT The employee with highest commission HIGHESTEMPLOYEE PRINT The total sales of employee with highest commission is MOSTSALES PRINT The commission of employee with highest commission HIGHESTCOMMISSION PRINT STAFFNAMES, TOTALSALES,COMMISSION FOR C = 1 TO 4 DO PRINT STAFFNAME, TOTALSALE, COMMISSION
TRACE TABLE
Staff Name Mary Phillip Jane Singh John Smith 5000 7000 8000 Total Sale Commission 5000*3/100 150>0 7000*3/100 210>150 8000*3/100 240>210 150 210 210 240 240 150 Highest Commission 0 Highest Employee Mary Phillip Jane Singh John Smith 5000 7000 8000 2 3 4 Most Sales 1 C -
Martian Lee Mary Phillip Jane Singh John Smith Martian Lee
300 300 -
10000 10000 -
VARIABLE TABLE
NAME STAFF NAME TOTAL SALE COMMISSION HIGHEST COMMISSION MOST SALES TYPE STRING REAL NUMBER REAL NUMBER REAL NUMBER REAL NUMBER DEFINATION Stores the name of staff member. Stores the total sales of staff member. Stores commission of staff member. Stores the highest commission made. Stores the total sales by employee with the highest commission. Stores the name of employee with the highest commission Stores the number of staff members
HIGHEST EMPLOYEE C
STRING INTEGER
PROCESSING
1. Read STAFF NAME and TOTAL SALE 2. Calculate commission of staff member. 3. Determine the highest commission and name of that staff member. 4. Print the staff member with the highest commission. 5. Print the total sales of employee with highest commission. 6. Print the commission of employee with highest commission. 7. Print name, total sales and commission of all staff members
OUTPUT
HIGHEST EMPLOYEE MOST SALES HIGHEST COMMISSION
STAFFNAMES
TOTAL SALES
COMMISSION
ALGORITHM STRUCTURE
The Commission Calculator Declaration: The commission calculator is a program that is designed to accept the names of sales staff members and their total sales for the month, and calculate the commission of these staff members at three percent respectively. The program then determines the highest commission. The program will then display the employee with the highest commission, the total sales of the employee with highest commission and it will also display the staff name, total sale and commission of all the staff members.