You are on page 1of 2

START

READ patientname
READ illness
READ medication
READ illnesslenght
READ quantity
READ price
READ subtotal
READ cost
READ discount
READ GCT
READ AmountPaid
READ x
READ Totalchickv,Totaldenguel

Totalchickv = 0
Totaldengue = 0
dis=0.12
G_C_T=0.165

FOR counter =1 to 5 do
PRINT “enter illness”
READ illness[x]

IF (illness[x] <> “chickv”) AND if (illness[x] <> “dengue”) THEN


PRINT “Sorry not now processing data for this illness”
ENDIF
PRINT “enter illness”
READ illness[x]
PRINT “enter patientname”
READ patientname[x]
PRINT “enter illnesslenght”
READ illnesslenght[x]
PRINT “enter medication”
READ medication[x]
PRINT “enter price”
READ price[x]
PRINT “enter quantity”
READ quantity[x]

subtotal[x]:=price[x]*quantity[x]*illnesslenght[x]

IF quantity[x]>12 THEN
discount[x]:= subtotal[x]*dis
ENDIF
cost[x]:= subtotal[x]- discount[x]
GCT[x]:= cost[x]* G_C_T
AmountPaid[x]:= cost[x]+ GCT[x]

IF illness[x]='chickv' THEN
Totalchickv:= Totalchickv+AmountPaid[x]
ENDIF

IF illness[x]='dengue' then
Totaldengue:= Totaldengue+AmountPaid[x]
ENDIF

FOR counter = 1 to 5 DO
PRINT “Patient Nane = “,patientname[x]
PRINT “Patient illness = “, illness[x]
PRINT “Length of illness = “ ,illnesslenght[x]
PRINT “Patient Medication = “,medication[x]
PRINT “Subtotal = “,subtotal[x]
PRINT “discount = “,discount[x]
PRINT “Total = “,cost[x]
PRINT “GCT = “,GCT[x]
PRINT “Amount Paid = “,AmountPaid[x]
PRINT “Total amount for Chick V = “,Totalchickv
PRINT “Total amount for Dengue = “,Totaldengue

PRINT “Pascal'
PRINT “Rushell Green'
PRINT “February 5, 2016'
ENDFOR

STOP

You might also like