0% found this document useful (0 votes)
54 views

Project No Rona - Software PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Project No Rona - Software PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

PROJECT NO RONA

Problem Solving

Centre Name: Campion College


Centre Number: 100016
Candidate: Justin Blackwood
Candidate Number: 10019201

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

WHILE (exit_code < 0) AND (exit_code > 0) DO


PRINT "Enter the patient's information."

PRINT "Patient's ID number ="


READ PID

PRINT "First Name ="


READ f_name
PRINT "Last Name ="
READ l_name
PRINT "Patient's gender ('M' for male or 'F' for female) ="
READ gender
PRINT "Patient's Status (positive, negative or inconclusive) ="
READ cov_status
PRINT "Discharge Status (Fully-recovered, Deceased, Out-patient)
=" READ dis_status
PRINT "Patient's Insurance type (GovC/Medi/NW/PariF/Sag) ="
READ ins_type
PRINT "Total Hospital Cost ="
READ Thosp_cost
PRINT "Covid Related Fees ="
READ cov_cost
IF (ins_type = "Medi") THEN
ins_cost <-- cov_cost * medi
ELSE
IF (ins_type = "Sag") THEN
ins_cost <-- cov_cost * sag
ELSE
IF (ins_type = "PariF") THEN
ins_cost <-- cov_cost * parif
ELSE
IF (ins_type = "NW") THEN
ins_cost <-- cov_cost * NW
ELSE
IF (ins_type = "GovC") THEN
ins_cost <-- cov_cost * govc
ENDIF
ENDIF

ENDIF

ENDIF

pat_num <-- pat_num + 1

IF (cov_status = "Positive") AND (dis_status = "Fully-recovered") OR (dis_status = "Out-


patient") THEN
pos_rout <-- pos_rout + 1

END
PRINT "Did the patient die? (Yes or No) ="

READ death
IF (cov_status = "Positive") AND (dis_status = "Deceased") AND (death = "Yes")

pos_deaths <-- pos_deaths + 1


ENDIF

d_rate <-- (pos_deaths/pat_num) * 100


p_cost <-- (Thosp_cost * 0.20) + (cov_cost - ins_cost)

ENDWHILE
PRINT "Number of positive patients who have recovered or are in outpatient care =", pos_rout,)

PRINT "Number of positive patients who died =", pos_deaths)


PRINT "The death rate =", d_rate)
END
Ordered Algorithm
1. BEGIN
2. DECLARE f_name, l_name, gender, cov_status, dis_ status, ins_type AS STRING
3. PID, Thosp_cost, cov_cost, ins_cost, p_cost, pos_deaths, pos_rout, pat_num, death, end_code AS
INTEGER
4. d_rate, ins_rate, medi, sag, parif, NW, govc AS FLOAT
5. PID  0
6. pat_num  0
7. pos_rout  0
8. pos_deaths  0
9. end_code  0
10. ins_rate  0
11. d_rate  0
12. medi  0.75
13. sag  0.80
14. parif  0.50
15. NW  0.47
16. govc  0.90
17. PRINT "If you wish to end it here, type in the exit code '9999', if you wish to continue, type in any
other number.”
18. READ end_code
19. WHILE (exit_code < 0) AND (exit_code > 0) DO
20. PRINT "Enter the patient's information."
21. PRINT "Patient's ID number ="
22. READ PID
23. PRINT "First Name ="
24. READ f_name
25. PRINT "Last Name ="
26. READ l_name
27. PRINT "Patient's gender ('M' for male or 'F' for female) ="
28. READ gender
29. PRINT "Patient's Status (positive, negative or inconclusive) ="
30. READ cov_status
31. PRINT "Discharge Status (Fully-recovered, Deceased, Out-patient) ="
32. READ dis_status
33. PRINT "Patient's Insurance type (GovC/Medi/NW/PariF/Sag) ="
34. READ ins_type
35. PRINT "Total Hospital Cost ="
36. READ Thosp_cost
37. PRINT "Covid Related Fees ="
38. READ cov_cost
39. IF (ins_type = "Medi") THEN
40. ins_cost <-- cov_cost * medi
41. ELSE
42. IF (ins_type = "Sag") THEN
43. ins_cost <-- cov_cost * sag
44. ELSE
45. IF (ins_type = "PariF") THEN
46. ins_cost <-- cov_cost * parif
47. ELSE
48. IF (ins_type = "NW") THEN
49. ins_cost <-- cov_cost * NW
50. ELSE
51. IF (ins_type = "GovC") THEN
52. ins_cost <-- cov_cost * govc
53. ENDIF
54. ENDIF
55. ENDIF
56. ENDIF
57. ENDIF
58. pat_num <-- pat_num + 1
59. IF (cov_status = "Positive") AND (dis_status = "Fully-recovered") OR (dis_status = "Out- 59.
patient") THEN
60. pos_rout <-- pos_rout + 1
61. ENDIF
62. PRINT "Did the patient die? (Yes or No) ="
63. READ death
64. IF (cov_status = "Positive") AND (dis_status = "Deceased") AND (death = "Yes")
65. pos_deaths <-- pos_deaths + 1
66. ENDIF
67. d_rate <-- (pos_deaths/pat_num) * 100
68. p_cost <-- (Thosp_cost * 0.20) + (cov_cost - ins_cost)
69. ENDWHILE
70. PRINT "Number of positive patients who have recovered or are in outpatient care =", pos_rout,)
71. PRINT "Number of positive patients who died =", pos_deaths)
72. PRINT "The death rate =", d_rate)
73. END
Trace Table

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

You might also like