final i.t programming

5

Click here to load reader

Upload: kavz

Post on 19-Feb-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Final i.t Programming

7/23/2019 Final i.t Programming

http://slidepdf.com/reader/full/final-it-programming 1/5

Problem defnition

Create a program that accepts the salesperson names, number of games sold,

revenue generated by game sales, and calculate and print the commission for a

salesperson along with the salesperson name and their revenue generated, also

calculate the total revenue generated, total commission for the day and the value of the highest commission obtained.

Input, Processing and Output table

INPUT PRC!""IN# UTPUT"alesperson names$

number of games sold$

revenue generated$

commission

%or each salesperson

calculate their

commission$ calculate the

total revenue generated,

total commission for theday, calculate the highest

commission obtained

"alesperson name$

revenue generated$

commission generated$

total revenue for the day$

total commission for theday$ highest commission

for the day

Identifer listingVariables

numgames & array$ integersalepersonname &array$ stringrevenuegen &array$ realcommission &real

 'N &charactera, b & integerhighestcommission & real Totalrevenue & real Totalcommission & real

Constants

ma(comper)*.+mincomper)*.+*

Page 2: Final i.t Programming

7/23/2019 Final i.t Programming

http://slidepdf.com/reader/full/final-it-programming 2/5

START

a←0

 b←0

Maxcommission0PRINT “Do you want to enter a record for a salesperson !"#N$%

"N←read&ey'(I)* +"#N,←-y-, and +a./, D1

2*3IN

a←+a45,

PRINT “*nter t6e name of salesperson%R*AD salepersonname 7a8PRINT “*nter t6e number of 9ames t6at t6is person sold%R*AD num9ames 7a8PRINT “*nter t6e re:enue earned by t6is salesperson%R*AD re:enue9en7a8

I; +num9ames 7a8</ 5=, T(*N2*3IN

commission7a8← +re:enue9en7a8 > maxcomper,*ND

*)S*2*3IN

commission7a8←+re:enue9en7a8 > mincomper,

*ND*NDI;I; +commission7a8 </ maxcommission, T(*N

2*3IN

maxcommission←commission7a8

*ND*NDI;PRINT “Do you want to enter a record for a salesperson !"#N$%

"N←read&ey*ND

;1R +b,←5 to a D1

2*3IN

totalre:enue←+totalre:enue 4 re:enue9en7b8,

totalcommission←+totalcommission 4 commission7b8,

*ND*ND;1R 

 b←5

;1R +b,←5 to a D1

2*3INPRINT ?Salesperson-@ salepersonname 7b8%

PRINT ?Number of 9ames sold-@ num9ames 7b8%PRINT ?Re:enue t6at earned -@ re:enue9en7b8%PRINT ?Bommission earned -@ “commission7b8%*ND

*ND;1R PRINT “Total Re:enue %@ ?totalre:enue-PRINT “Total Bommission %@ ?totalcommission-PRINT “(i96est commission recei:ed by “salepersonname 7b8@ “@ was paid %@ maxcommission@ “commissionC%*ND

Page 3: Final i.t Programming

7/23/2019 Final i.t Programming

http://slidepdf.com/reader/full/final-it-programming 3/5

Pascal Al9orit6m

 pro9ram 9eneratoruses crt

:ar num9amesE Array 75CC5008 of inte9ersalepersonnameE Array 75CC5008 of strin9re:enue9enE Array 75CC5008 of realcommissionE Array 75CC5008 of real"NE c6ara@ b Einte9er6i96estcommission@ totalcommission@ totalre:enueEreal

constmaxcomper/0C5=

mincomper/0C50

 be9inaE/0 bE/06i96estcommissionE/0

write+FDo you want to enter a record for a salespersonF,"NE/read&ey

if+lowercase+"N,.<FyF, t6en be9in

  writeln+Fno data enteredC press any &ey to closeF,  exitend

w6ile+lowercase+"N,/FyF,and+a./, do  be9in  aE/+a45,  write+FPlease enter t6e name of t6e salespersonE F,  readln+salepersonname7a8,  write+FPlease enter t6e number of 9ames t6at t6is person soldE F,  readln+num9ames7a8,  write+FPlease enter t6e re:enue earned by t6is salespersonE F,

  readln+re:enue9en7a8,

  if+num9ames7a8</5=,t6en  commission7a8E/+re:enue9en7a8>maxcomper,  else  commission7a8E/+re:enue9en7a8>mincomper,

  if+commission7a8</6i96estcommission,t6en  be9in

Page 4: Final i.t Programming

7/23/2019 Final i.t Programming

http://slidepdf.com/reader/full/final-it-programming 4/5

  6i96estcommissionE/commission7a8  end

  writeln +FDo you want to enter a record for anot6er salespersonF,  "NE/read&ey  end

for+b,E/ 5 to a do be9intotalre:enueE/+totalre:enue 4 re:enue9en7b8,totalcommissionE/+totalcommission 4 commission7b8,end

 bE/5clrscr

writeln+FGGGGGGGGGGF,writeln+Fday reportF,

writeln+FGGGGGGGGGGF,for+b,E/ 5 to a do be9inwriteln+FGGGGGGGGGGF,writeln+FsalespersonE F@salepersonname7b8,writeln+Fnumber of 9ames sold F@num9ames7b8,writeln+Fre:enue t6at earnedE F@re:enue9en7b8EHEH,writeln+Fcommission earnedE F@commission7b8EHEH,endwriteln+FGGGGGGGGGGF,writeln+Ftotal re:enue 9eneratedE F@totalre:enueEHEH@FCF,writeln+Ftotal commissionE F@totalcommissionEHEH@FCF,

writeln+F6i96est commission was recei:ed by F@salepersonname7a8@F@ was paid F@6i96estcommissionEHEH@FcommissionCF,writeln+FGGGGGGGGGGF,writeln+Fpress enter to closeF,readlnendC

Page 5: Final i.t Programming

7/23/2019 Final i.t Programming

http://slidepdf.com/reader/full/final-it-programming 5/5

Rishi loor-hoor

Naparima College

IT "/

PR#R00IN#