You are on page 1of 3

PSEUDOCODE Start NAMES: array [1...] of string TOTALSALES: array [1...] of real COMM: array [1...

]Of real set i=0, total=0, max=-1, maxname= , maxsales=0, For i= 1 to do NAMES[i] = TOTALSALES[i] = 0 COMM[i] =0 End for For i=1 to do Read NAMES[i] Read TOTALSALES[i] Set COMM[i] = 0.03*TOTALSALES[i] If (COMM[i] > max) then Max= COMM[i] Maxname= NAME[i] Maxsales= TOTALSALES[i] End if Total=total+COMM[i] End for Print (the highest commission by a salesstaff is:, Max) Print (the sales staff with the highest commission is: Maxname) Print (the total sales of the sales staff with the highest commission is: Maxsales) End.

DEFINING DIAGRAM INPUT Name, total sales, commission PROCESSING Create 3 arrays NAME, COMM, TOTALSALES to store the sales staffs names, their commission and total sales Read total sales for the sales staff Calculate the commission for the employees Determine the highest commission made by a sales staff , the name of the sales staff with the highest commission and the total sales of the sales staff with the highest commission Print the highest commission made by a sales staff Print the name of the sales staff with the highest commission Print the total sales of the sales staff with the highest commission OUTPUT the highest commission made by a sales staff the name of the sales staff with the highest commission the total sales of the sales staff with the highest commission

TABLE OF VARIABLES Variable Name i total max maxname Variable Type Integer Real Real String Description Counter variable used in for loop Keeps track of the maximum commission Holds the name of the sales staff with the highest commission Keeps track of the maximum sales Stores the name of the sales staff Stores the commission of the sales staff Stores the total sales of the sales staff

maxsales NAMES COMM TOTALSALES

Real Array[1 to 10] of string Array[1 to 10] of real Array[1 to 10] of real

You might also like