You are on page 1of 7

DISCOUNT TAX CUSTCHR CUSTpay Lawncare Landscapping TreeTrimming FenceInstallation

PROGRAM CALCULATION;

{This program will calculate the total payment and total charge of a customer}

const

DiscRate=0.1;

TaxRate=0.15;

TreetrimPrice=13,000.00;

LawncarePrice=34,000.00;

FenceInstPrice=190,000.00;

LandscapePrice=400,000.00;

var

FName, LName, Servtype, Servday:string;

DiscAmount, TaxAmount, GrandTotalCustomerCharge, GrandTotalPayment, HighestCharge,


TreetrimCustCharge, LawncareCustCharge, FenceInstCustCharge, LandscapeCustCharge,
TreeTrimpayment, FenceInstpayment, Lawncarepayment, Landscapepayment, GrandTotal,
CustPayment, CustCharge, Payment, totalcharge:real;

Count, Balance:integer;

Begin

DiscAmount:=0;

TaxAmount:=0;

GrandTotal:=0;

CustCharge:=0;
CustPayment:=0;

TreetrimCustCharge:=0;

LawncareCustCharge:=0;

FenceInstCustCharge:=0;

LandscapeCustCharge:=0;

TreeTrimpayment:=0;

FenceInsttpayment:=0;

Lawncarepayment:=0;

Landscapepayment:=0;

For Count:=1 to 2 Do

BEGIN

Writeln('Enter FName,LName');

Readln (FName,LName);

Writeln('Enter Servtype');

Readln (Servtype);

Writeln('Enter Servday');

Readln (Servday);

If (Servtype='Treetrim') then

begin
If (Servday='Monday')then

begin

DiscAmount:= TreetrimPrice* DiscRate;

end;

TaxAmount:=( TreetrimPrice- DiscAmount)* TaxRate;

CustCharge:=(TreetrimPrice- DiscAmount)+ TaxAmount;

Writeln('The total charge for your tree trimming service is:


',CustCharge:0:2);

Writeln('Enter your payment');

Readln (payment);

TreetrimCustCharge:=TreetrimCustCharge +CustCharge;

TreeTrimpayment:=TreeTrimpayment+ payment;

end

else

If (Servtype='Lawncare') then

begin

If (Servday='Monday')then

begin

DiscAmount:= LawncarePrice* DiscRate;

end;

TaxAmount:=( LawncarePrice- DiscAmount)* TaxRate;

CustCharge:=(LawncarePrice- DiscAmount)+ TaxAmount;


Writeln('The total charge for your lawn care service is:
',CustCharge:0:2);

Writeln('Enter your payment');

Readln (payment);

LawncareCustCharge:= LawncareCustCharge+CustCharge;

Lawncarepayment:=Lawncarepayment+ payment;

end

else

If (Servtype='FenceInst') then

begin

If (Servday='Monday')then

begin

DiscAmount:= TreeplantPrice* DiscRate;

end;

TaxAmount:=( FenceInstPrice- DiscAmount)* TaxRate;

CustCharge:=( FenceInstPrice- DiscAmount)+ TaxAmount;

Writeln('The total charge for your tree planting service is:


',CustCharge:0:2);

Writeln('Enter your payment');

Readln (payment);

FenceInstCustCharge := TreeplantCustCharge+CustCharge;

FenceInstpayment:=Treeplantpayment+payment;
end;

else

If (Servtype='Landscape') then

begin

If (Servday='Monday')then

begin

DiscAmount:= LandscapePrice* DiscRate;

end;

TaxAmount:=( LandscapePrice- DiscAmount)* TaxRate;

CustCharge:=(LandscapePrice- DiscAmount)+ TaxAmount;

Writeln('The total charge for your landscaping service is:


',CustCharge:0:2);

Writeln('Enter your payment');

Readln (payment);

LandscapeCustCharge:=LandscapeCustCharge+ CustCharge;

Landscapepayment:=Landscapepayment+payment;

end;

end;
GrandTotalPayment:=
Treetrimpayment+Lawncarepayment+Landscapepayment+FenceInsttpayment;

totalcharge:= TreetrimCustCharge + LawncareCustCharge +FenceInstCustCharge


+LandscapeCustCharge;

If (TreetrimCustCharge > LawncareCustCharge) then

HighestCharge:=TreetrimCustCharge

Else

HighestCharge:= LawncareCustCharge;

If LawncareCustCharge> LandscapeCustCharge then

HighestCharge:= LawncareCustCharge

Else

HighestCharge:= LandscapeCustCharge;

If LandscapeCustCharge> FenceInstCustCharge then


HighestCharge:= LandscapeCustCharge

Else

HighestCharge:= FenceInstCustCharge;

IF GrandTotalPayment>totalcharge THEN

Writeln('Your business is making a profit')

else

IF GrandTotalPayment<totalcharge THEN

Writeln('Your business is at a loss')

else

IF GrandTotalPayment=totalcharge THEN

Writeln('Your business is at a break even');

end.

You might also like