Está en la página 1de 13

PROBLEM STATEMENT

The program accepts the names of 10 sales staff members. It stores: their first name, surname,
their total sales for the month and the program calculates each member’s commission of 7% of
their sales amount for the month. The program displays the name of the person with the highest
commission and displays the names of the persons with a commission less than $1500. Finally,
the program will print the name of the staff member with the highest commission and the
members with a commission of less than $1500.

Limitation
 The program does not cater for persons with the same salary.
 This program only accepts ten persons.

Assumptions
 The program assumes that no one has a salary of $0 therefore no one will have a commission of $0.
 The program accommodates 10 persons.
List of variables
Counter: holds the names of the sales staff members, total sales and commission
less_than_average: holds the members that have a commission of less than $1500
name: holds the names of the sales staff members
ts: holds the total sales of each sales staff member
c: holds the commission of each sales staff member
HICOM: holds the highest commission.
TOTALS: holds the highest total sales
Hname: holds the name of the person with the highest commission
PSEUDOCODE
Step1: START
Step 2: c0.07
Step 3: counter integer
Step 4: less_than_average  integer
Step 5: less_than_average 0;
Step 6: Hname
Step 7: Hicom0;
Step 9 : Totals0;
Step 10: For counter 1 to 10 do
Begin
Step 11: Write ('Enter name of employee');
Read(name[counter]);
Write('Enter total sales');
Readln (ts[counter]);
Step 11: c[counter](ts[counter]*0.07)
Step12: Write (commission=,c[counter])
Step13: If c[counter]<1500 then
less_than_averageless_than_average+1
Step 14: Write (less_than_average,' person has a commission of less than 1500.');
Step 15: For counter  1 to 10 do
Begin

Step16:
If c [counter] > HICOM THEN
HICOM c [counter];

If c [counter] = HICOM THEN


Totals ts [counter];

If ts [counter] = totals then


Hname name [counter] ;
Step 17: Write ('The person with the highest commission is ',Hname, ' with a
commission of $',HICOM, ' and total sales of $',totals);
Step 18: Stop.
TEST DATA
NAME TOTAL SALES COMMISSION
Xephora Ballies $16200.00 $2800.00
Tristan Ligaya $21800.00 $2100.00
Jada Steffanina $23900.00 $.00
Avankita Pitts $4000.00 $700.00
Arberi Ferraj $1200.00 $840.00
Jason Nash $3100.00 $1190.00
Brennen taylor $10000.00 $217.00
Victor Jakovenko $123.00 $86.10
Matt Cutshall $7000.00 $490.00
King Vader $15000.00 $1050.00
Trace Table
Name Total Sale Commi Count Highest Count be
ssion commission commission $1500
(7%)
Trinity
Power
Program Listing

Program sale_staff;
{The program accepts the name of ten (10) sale staff members
with their: name, total sales for the month then it calculates the
commission of 7% of their total sale amount. It displays names,
total sales and commission of member with the highest
commission and the number of the persons with less than $1500
commission.}

Var
counter, less_than_average :integer;
name: array[1..10] of string;
ts: array[1..10] of real;
c : array[1..10] of real;
HICOM,TOTALS:Real;
Hname:string;

Begin
less_than_average:=0;
hicom:= 0;
totals:=0;

For counter := 1 to 10 do
Begin
Writeln ('Enter name of employee');
Readln (name[counter]);
Writeln('Enter total sales');
Readln(ts[counter]);
c[counter]:=(ts[counter]*0.07);
Writeln('Commission =', c[counter]:7:2);

If c[counter]<1500 then
less_than_average:=less_than_average+1

End;
Writeln(less_than_average,' persons has a commission of less
than 1500.');

For counter := 1 to 10 do
begin
If c [counter]> HICOM THEN
HICOM:= c[counter];

If c[counter]=HICOM THEN
totals:= ts[counter];

If ts[counter] = totals then


hname:= name[counter] ;

end;

Writeln ('The person with the highest commission is


',Hname, ' with a commission of $',HICOM:7:2, ' and total sales of
$',totals:7:2);
End.
RESULTS

También podría gustarte