Project No Rona - Software PDF
Project No Rona - Software PDF
Problem Solving
Software
Contents
Variable List ..................................................................................................................................................
1 Problem Statement
...................................................................................................................................... 2 Unordered
Algorithm ................................................................................................................................... 3 Ordered
Algorithm ....................................................................................................................................... 6 Trace
Table .................................................................................................................................................... 8
Python Code ................................................................................................................................................
9
Variable List
Variable Data Type Description
f_name String First Name of Patient
l_name String Last Name of Patient
gender String Gender of Patient
cov_status String Patient’s Covid Status
dis_status String Patient’s Discharge Status
ins_type String The Insurance type of the patient
PID Integer The ID of the Patient
Thosp_cost Integer Total Hospital Cost
cov_cost Integer Covid Related Fee
ins_cost Integer The amount that is covered by the insurance
p_cost Integer Amount to be paid by the patient
pos_deaths Integer Number of positive patients who died
pos_rout Integer The number of positive patients who are Fully-
recovered or in out-patient care
pat_num Integer Number of patients
death Integer Death status of the patient
end_code Integer The code to end the program
d_rate Float Death Rate of positive cases
ins_rate Float The rate of insurance of the patient’s choice
medi Float Mediplus Health Insurance Jamaica Limited insurance
sag Float coverage
Sagicor Health Jamaica Limited insurance coverage
parif Float
Parishfarm insurance coverage
NW Float Nationwide Health Limited insurance coverage
govc Float Ministry of Health - GovCare insurance coverage
Problem Statement
You are required to write an algorithm that will accept patient information until the user enters 9999:
PID, First Name, Last Name, Gender, Total Hospital Cost and Covid Related Costs, Covid Status
(inconclusive, positive, or negative), Discharge Status, and Insurance type. Calculate for each patient,
what the insurance pays based on the percentages given in the Database section and what the patient
pays based on the criteria given in the Spreadsheet section.
At the end, you are to:
1. Display the number of positive patients who have recovered or are in outpatient care.
2. Display the number of persons who died and tested positive for COVID-19.
3. Display the death rate i.e., the percentage of persons who have died from Covid.
Unordered Algorithm
BEGIN
DECLARE f_name, l_name, gender, cov_status, dis_ status, ins_type AS STRING
PID, Thosp_cost, cov_cost, ins_cost, p_cost, pos_deaths, pos_rout, pat_num, death, end_code
AS INTEGER
d_rate, ins_rate, medi, sag, parif, NW, govc AS FLOAT
PID 0
pat_num 0
pos_rout 0
pos_deaths 0
end_code 0
ins_rate 0
d_rate 0
medi 0.75
sag 0.80
parif 0.50
NW 0.47
govc 0.90
PRINT "If you wish to end it here, type in the exit code '9999', if you wish to continue, type in any other
number.”
READ end_code
ENDIF
ENDIF
END
PRINT "Did the patient die? (Yes or No) ="
READ death
IF (cov_status = "Positive") AND (dis_status = "Deceased") AND (death = "Yes")
ENDWHILE
PRINT "Number of positive patients who have recovered or are in outpatient care =", pos_rout,)
TRACE TABLE
Line l_name cov_statusdis_status Thosp_cost ins_c ostp_costpat_num pos_rout pos_deathsd_rate Output
NumbPIDf_nam gender - ins_type - - - cov_cost - - 0000 -
e 1-160 - - Positive Deceased -- $ 25,200.00 1011 -
17-69 8750 Rose F Medi Posittive $ 288,000.00$ 2010.5 -
Daisy 17-69 Diggons Deceased PariF 28,000.00 $ 3110.33 -
2064 Jared 17- M Positive Fully- 397,000.00$ 4120.5 -
698691Yohan Thompso recovered NW 32,000.00 $ 5220.4 -
17-69 4654 nM Positive Deceased 237,500.00$ 6320.33 -
Leanna 17-69 Smith F GovC Positive 22,500.00 $ 7320.28 -
3479 Lucus 17- Dunn M Deceased GovC 518,000.00$ 8320.25 -
699714Sydney Patterson Positive Fully- 48,000.00 $ 9420.22 -
17-69 8981 F Rrecovered PariF 502,500.00$ 10430.3 -
Abigail 17-69 Bolt F Positive Fully- 47,500.00 $ 10430.3 -
4123 Oscar 17- Roth M Recovered Sag 375,000.00$ - - 10430.3pos_rout = 4
69 9253 Shawn Smith M Positive Deceased 40,000.00 $ - - pos_deaths = 3
17-69 3879 Mchail M GovC Positive Out- 260,000.00$ d_rate = 0.3
Chris 17-690 - -- Patient Medi Positive 30,000.00 $
70-730 - -- Deceased Sag 437,000.00$
--- 42,000.00 $
--- 76,000.00$
11,000.00 $
421,000.00$
41,000.00
--
--
Python Code