Professional Documents
Culture Documents
Pseudocode Algorith 2
Pseudocode Algorith 2
START
VARIABLE DECLARATION
fullname,ads,magt,magte as string
qty,i,unitcost as integer
paypub,Disin,sales,comm as real
DECLARING CONSTANTS
Rate1 = 0.1
Rate2 = 0.2
INITIALIZING VARIABLES
i=0
for i= 1 to 25 do
Read(fullname)
read(ads)
read(magt)
read(magte)
PRINT(“Specify the amount you wish to purchase”)
read(qty)
if(magt=“Fashion”)then
unitcost=150
Endif
if(magt=“Sport”)then
unitcost=200
Endif
if(magt=“Health”)then
unitcost=100
Endif
if(magt=“Computer”)then
unitcost=135
Endif
if(magt=“Home Decorating”)then
unitcost=150
Endif
sales= qty*unitcost
paypub= sales*0.6
if (qty<=200)then
comm=Rate1*sales
else
comm=Rate2*sales
Endif
Disin= sales-(paypub+comm)
STOP
PASCAL CODES
PROGRAM Clarendon_Distribution;
{This program was created by Shane Allison to provide a friendly interface for clients in
gathering information about products and making purchases.It was created on April 2,2022
on Ezy Pascal.}
VAR fullname,ads,magt,magte:string;
qty,i,unitcost:integer;
paypub,Disin,sales,comm:real;
Rate2 = 0.2;
Begin
writeln;
writeln('-----------------------------------------------------');
writeln;
i:=0;
for i:= 1 to 25 do
begin
writeln('\________________________________________/');
Readln(fullname);
Writeln('Please enter your address here');
readln(ads);
readln(magt);
readln(magte);
readln(qty);
if(magt='Fashion')then
unitcost:=150;
if(magt='Sport')then
unitcost:=200;
if(magt='Health')then
unitcost:=100;
if(magt='Computer')then
unitcost:=135;
if(magt='Home Decorating')then
unitcost:=150;
sales:= qty*unitcost;
End;
writeln;
writeln('**~~~~~~~~~~PUBLISHERS DETAILS~~~~~~~~~~**');
writeln;
paypub:= sales*0.6;
if (qty<=200)then
comm:=Rate1*sales
else
comm:=Rate2*sales;
writeln('\\______________________//');
writeln;
Disin:= sales-(paypub+comm);
writeln;
End.
PROGRAM OUTPUT
TRACE TABLE
TEST DATA