write program 2

Download Write Program 2

If you can't read please download the document

Upload: jordon-rhule

Post on 22-Dec-2015

6 views

Category:

Documents


3 download

DESCRIPTION

A source code for a program

TRANSCRIPT

program TheBoutique;Usesmath, crt;label stop; VarTotalSales : Integer;no_com, commission, max, sales : Real;name, best, choice : string; x : integer; Beginclrscr;textcolor(yellow);WriteLn;writeln;WriteLn;writeln;no_com:=0;max:=0;for x:= 1 to 15 dobegin writeln; writeln; write('Please Enter Employee`s Name: '); readln (name); writeln; write('Please Enter Employee`s Total Sales: $'); readln (TotalSales); commission:= TotalSales * 0.05; writeln; write ('Employee Total Commission Is $'); writeln(commission:5:2); writeln; if (commission =0) then begin no_com:=no_com+1; end else if(commission >max) then begin max:= commission; best:=name; sales:= TotalSales; {Doing this makes the 'name' value with the highest 'TotalSales' value be assigned to the required variables} end; writeln('Press if you wish to continue entering names.'); writeln('Write "Stop" then press if you wish to stop.'); readln(choice); if choice = 'Stop' then beginclrscr;Writeln;writeln;WriteLn('The sales staff member with the highest commission is ', best);writeln('Their commission is $', max:8:2);writeln('Their total sales figure is $', sales:10:2);WriteLn('The amount of sales staff members without a commission is ',no_com:1:0,'.');Writeln;Writeln;Writeln('Press To Exit');Readln;goto stop; end;end;stop:End.