Documentos de Académico
Documentos de Profesional
Documentos de Cultura
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: c0.07
Step 3: counter integer
Step 4: less_than_average integer
Step 5: less_than_average 0;
Step 6: Hname
Step 7: Hicom0;
Step 9 : Totals0;
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_averageless_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];
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];
end;