You are on page 1of 9

PSEUDOCODE ALGORITHM

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

PRINT(“Welcome Please enter your full name here”)

Read(fullname)

PRINT(“Please enter your address here”)

read(ads)

PRINT(“Please enter the type of magazine of your purchase”)

read(magt)

PRINT(“State the title of your magazine”)

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

PRINT(“The total sales amount of this purchase is $”,sales:2:2)

paypub= sales*0.6

PRINT(“The payment to publisher will be $”,paypub:2:2)

if (qty<=200)then

comm=Rate1*sales

else

comm=Rate2*sales

Endif

PRINT(“your commission is $”,comm:2:2)

Disin= sales-(paypub+comm)

PRINT(“The distributors income will be $”,Disin:2:2)

PRINT(“**Thank you for your subscription..Have a pleasant day.**”)

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;

Const Rate1 = 0.1;

Rate2 = 0.2;

Begin

writeln('**~~~~~~~~CLARENDON DISTRIBUTION LIMITED~~~~~~~**');

writeln;

writeln('**~~~~~~~~~MAGAZINE DISTRIBUTION & SALES~~~~~~**');

writeln('-----------------------------------------------------');

writeln;

i:=0;

for i:= 1 to 25 do

begin

writeln('\________________________________________/');

writeln('Welcome Please enter your full name here');

Readln(fullname);
Writeln('Please enter your address here');

readln(ads);

writeln('Please enter the type of magazine of your purchase');

readln(magt);

writeln('State the title of your magazine');

readln(magte);

Writeln('Specify the amount you wish to purchase');

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;

writeln('The total sales amount of this purchase is $',sales:2:2)

End;

writeln;

writeln('**~~~~~~~~~~PUBLISHERS DETAILS~~~~~~~~~~**');

writeln;

paypub:= sales*0.6;

writeln('The payment to publisher will be $',paypub:2:2);

if (qty<=200)then

comm:=Rate1*sales

else

comm:=Rate2*sales;

writeln('\\______________________//');

writeln('your commission is $',comm:2:2);

writeln;

Disin:= sales-(paypub+comm);

writeln('The distributors income will be $',Disin:2:2);

writeln;

writeln('**~~~~~~~~~CLARENDON DISTRIBUTIONS LIMITED~~~~~~~~~~~~**');


Writeln('**Thank you for your subscription..Have a pleasant day.**')

End.
PROGRAM OUTPUT
TRACE TABLE
TEST DATA

NAMES ADDRESS QUANTITY MAGAZINE TYPE MAGAZINE TITLE


Johnny Blake Paradis 300 Sport Men’s Health
Zeke Halsted Longwalk 500 Home Decorating Southern Living
Sam Jeager Eldian Street 129 Fashion Vogue
Shane Allison High Hills 495 Health Self
Annie Fearon Flood Path 175 Computer Computer World
Linda Brown Mt.Hindmost 110 Health Prevention
Steven Banner Pieck Tress 213 Computer WIRED
Bruce Wayne Park Hall 450 Sport ESPN
Racquel Fearon Marleyon 250 Fashion Elle
James Barnes Twp Paths 315 Home Decorating Veranda

You might also like