Declare Const
regfee = 500
T1 = 1550
T2 = 2500
T3 = 3000
MG01 = 0.80
MS02 = 0.70
WD03 = 0.75
NN04 = 0
check:string
patient:array[1..40] as string
regnum:array[1..40] as string
parish:array[1..40] as string
centretype:array[1..40] as integer
company:array[1..40] as string
bloodtest:array[1..40] as string
bloodtestamt:array[1..40] as integer
surcharge:array[1..40] as real
bloodtesttotal:array[1..40] as real
docfee:array[1..40] as integer
inaltotal:array[1..40] as real
insuranceamt:array[1..40] as real
patamt:array[1..40] as real
count,pbellosumpatients,irishsumpatients,queenssumpatients,fairysumpatients integer
pbellosum,irishsum,queenssum,fairysum real
Begin
count 0
Print
Print ('Enter the Registration Number of the patient or No to Exit')
readln(check)
Repeat
Begin
count count + 1
regnum[count] check
Read(patient[count])
Read(parish[count])
Print ('Enter the health centre type that the patient attended')
Read(centretype[count])
If centretype[count] = 1 then
docfee[count] T1
If centretype[count] = 2 then
docfee[count] T2
If centretype[count] = 3 then
docfee[count] T3
Print ('Enter the name of the insurance company or "none" if the patient wasnt
insured')
Read(company[count])
Print ('Did the patient conduct a blood check? Type Y for yes or N for No ')
Read(bloodtest[count])
If bloodtest[count] = 'Y' then
bloodtestamt[count] 950
ELSE
bloodtestamt[count] 0
surcharge[count] bloodtestamt[count]*0.1
Begin
pbellosumpatients pbellosumpatients + 1
End
Begin
queenssumpatients queenssumpatients + 1
End
Begin
irishsumpatients irishsumpatients + 1
irishsum irishsum + finaltotal[count]
End
Begin
fairysumpatients fairysumpatients + 1
Read(check)
End
Begin
Print ('There were ',irishsumpatients,' patients from irishsum Town') Print ('Patients
from irishsum Town totalled $',irishsum:0:2)
End
If check = 'END' then
Read
End.