You are on page 1of 6

Problem Statement

Develop an algorithm using pseudocode or flowchart that accepts as input relevant information
for an unspecified number of patients. A patient may be from any one of the four parishes.  The
algorithm should determine the total costs incurred by each patient. 
• This includes registration fee, doctor’s fee, insurance fee and subtotal.
• The algorithm should print the total number of patients from each parish.

IPO Chart
INPUT PROCESSING OUTPUT
 Title  Calculate Total (registration fee +  Title
 First name doctor fee + test fee)  First name
 Last name  Calculate Insurance payment  Last name
 Parish (total * insurance percentage)  Parish
 Health center  Calculate Sub total  Health Center
 Insurance Code (total – insurance payment)  Insurance Code
 Calculate total patients in each parish  Total
 Insurance payment
 Sub total
 Total patients in each parish

Pseudocode
START
SET SA 80%
SET GU 70%
SET BC 60%
SET NN 0%
DECLARE title, fname, lname, hc AS STRING
parish, kcount, account, ccount, clcount, choice AS INTEGER
icode AS CHARACTER
total, insurance, subtotal, doc_fee AS REAL
title = “ “
fname = “ “
lname = “ “
hc = “ “
choice = 0
parish = 0
kcount = 0
acount = 0
ccount = 0
clcount = 0
icode = ‘ ‘
parish = ‘ ‘
total = 0.0
insurance = 0.0
subtotal = 0.0
doc_fee = 0.0
WRITE “1 = ADD PATIENT”
WRITE “2 = VIEW TOTALS”
WRITE “3 = EXIT”
WRITE “CHOICE ?”
READ (choice)
WHILE choice NOT EQUAL 3 DO BEGIN
IF choice = 1 THEN
WRITE “Enter Title [Mr, Ms, Mrs] “
READ (title)
WRITE “Enter First Name“
READ (fname)
WRITE “Enter Last Name“
READ (lname)
WRITE “Enter Parish [1 = Kingston / 2 = St. Andrew / 3 = St. Catherine /
4 = Clarendon“
READ (parish)
WRITE “Enter Health Center [T1 / T2 / T3]”
READ (hc)
WRITE “Enter Insurance Code [S = Sagicor / B = Blue Cross / G =
Guardian / N = None]”
READ (icode)
IF hc = “T1” THEN
doc_fee = 1500
ELSE
IF hc = “T2” THEN
doc_fee = 2500
ELSE
doc_fee = 3000
ENDIF
ENDIF
IF icode = ‘S’ THEN
insurance = total * SA
ELSE
IF icode = ‘B’ THEN
insurance = total * BC
ELSE
IF icode = ‘G’ THEN
insurance = total * GU
ELSE
IF icode = ‘N’ THEN
insurance = total * NN
ENDIF
ENDIF
ENDIF
ENDIF
IF parish = 1 THEN
kcount = kcount + 1
ELSE
IF parish = 2 THEN
acount = acount + 1
ELSE
IF parish = 3 THEN
ccount = ccount + 1
ELSE
IF parish = 4 THEN
clcount = clcount +1
ENDIF
ENDIF
ENDIF
ENDIF
total = 500 + doc_fee + 5500
subtotal = total – insurance
WRITE “TOTAL = $”, total
WRITE “INSURANCE PAYMENT = $”, insurance
WRITE “BALANCE = $”, subtotal
ENDIF
IF choice = 2 THEN
WRITE “PATIENTS FROM KINGSTON = ”, kcount
WRITE “PATIENTS FROM ST. ANDREW = ”, account
WRITE “PATIENTS FROM ST. CATHERINE = ”, ccount
WRITE “PATIENTS FROM CLARENDON = ”, clcount
ENDIF
IF choice = 3 THEN
WRITE “WRITTEN BY: TEACHER”
ENDIF
WRITE “1 = ADD PATIENT”
WRITE “2 = VIEW TOTALS”
WRITE “3 = EXIT”
WRITE “CHOICE ?”
READ (choice)
ENDWHILE
STOP
DATA DICTIONARY
NAME VARIABLE / CONSTANT DATA TYPE PURPOSE
SA CONSTANT REAL STORES THE PERCETAGE PAID
BY SAGICOR
GU CONSTANT REAL STORES THE PERCETAGE PAID
BY GUARDIAN
BC CONSTANT REAL STORES THE PERCETAGE PAID
BY BLUE CROSS
NN CONSTANT REAL USED FOR PATIENTS WITH NO
HEALTH INSURANCE

You might also like