ption 2: Display the Record of a particular Patient When a user selects option 2, The main function prompts for and reads a PatientID. Then it calls the the function getPatient(patientID), which then searches for this PatientID in the text-file. If the Patient is not found, an appropriate error message is displayed, otherwise; the Patient’s information is displayed. In both cases, the option waits for the Enter key to be pressed before returning control to the main menu. Please select your choice: 2 Enter Patient ID: 1002 Patient ID Patient Name Weight Ave. Weight Visits 1002 Majed Sameer 18 .6 18 .2 2 Press Enter key to continue . . . Please select your choice: 2 Enter Patient ID: 1552 Error: Invalid Patient Press Enter key to continue . . .

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Option 2: Display the Record of a particular Patient
When a user selects option 2, The main function prompts for and reads a PatientID. Then it calls the the
function getPatient(patientID), which then searches for this PatientID in the text-file. If the Patient is not
found, an appropriate error message is displayed, otherwise; the Patient’s information is displayed. In
both cases, the option waits for the Enter key to be pressed before returning control to the main menu.
Please select your choice: 2
Enter Patient ID: 1002
Patient ID Patient Name Weight Ave. Weight Visits
1002 Majed Sameer 18 .6 18 .2 2
Press Enter key to continue . . .
Please select your choice: 2
Enter Patient ID: 1552
Error: Invalid Patient
Press Enter key to continue . . .

 

Option 3: Display all Patient Weight
It prompts for- and reads a maximum weight from the user. Then it displays all patients with weight less
than or equal to the give weight. Also, it displays the percentage weight increase (with a + sign) or
decrease (with a - sign) in the patients weight from the average weight, using the formula in Eqn (1)
below:
P = (weight – average weight)/ (average weight) x 100 ……………………………… (1)
Please select your choice: 3
Please enter max. weight (Kg): 55
Patient ID Patient Name Weight Ave. Weight P(%) Visits
1007 Ahmad Said 51.5 51.5 0.00 1
1003 Suleiman Wasim 25.5 28.5 -10.53 2
1002 Majed Sameer 18 .6 15 .2 +22.37 2
1001 Aisha Abdullatif 10.1 10.1 0.00 1
Press Enter key to continue . . .
Please select your choice: 3
Please enter max. weight (Kg): - 55
Error: Invalid withdraw amount
Press Enter key to continue . . .

 

Option 4. Update Patient
This option uses the function update(patientID, weight). It prompts for and reads a PatientID, and their
current weight (weight). The new average weight can be calculated using Eqn (2) and the new visit
counts can be calculated using Eqn (3).
Ave. weight = (weight + ave. weight * visit) / (visit + 1) …………………………………….. (2)
visit = visit + 1 ………………………………………………………………………...…. (3)
If the PatientID is zero, or the PatientID, visits and/or any of the weights (i.e., weight and average
weight) is negative an appropriate error message is displayed; otherwise it searches for this PatientID in
the text-file and update their record as described earlier. Also, if the PatientID is not found an
appropriate error message is displayed, as shown by the test run below:
Please select your choice: 4
Please enter Patient ID: 1001
Please enter current weight (Kg): 11.15
Please enter average weight (Kg): 10.25
Please enter the patients number of visits: 3
Patient’s information has been updated . . .
Press Enter key to continue . . .
Please select your choice: 4
Please enter Patient ID: 2256
Please enter current weight (Kg): 11.15
Please enter average weight (Kg): 10.25
Please enter the patients number of visits: 3
Error: Invalid patient ID
Press Enter key to continue . . .
Please select your choice: 4
Please enter Patient ID: 1001
Please enter current weight (Kg): -11.15
Please enter average weight (Kg): 10.25
Please enter the patients number of visits: 3
Error: Invalid weight
Press Enter key to continue . . .
Control is returned to the main menu after pressing the Enter key.

 

Options 5. Add New Patient
To implement Option 5, search the text-file for the PatientID of the record to be added. If the PatientID
exists, display an error; otherwise append the new record to the end of the text-file.

 

Options 6. Delete Patient
To implement option 6, search the text-file for the PatientID and deleted the patient when found. If the
PatientID does not exist, display an error.
Note:
 Use the clause throws FileNotFoundException or throws IOException for each method that
performs File I/O.
 You must not share code with another project group. Doing so will result in a zero grade for all
groups involved.

-----------------------

please make new code or correct my code , but the problem i cant send my code here because the code is too long.

in my code i have an problem in options 5 and 6

b.
الدرجار
dazjj * Regist O
Questi C Woroj C
Questi C Get Hc C
Could C whats O
Sec 4.
Bb
Bb
ICS104 Bb
X ICS Bb
Uploac Bb
Answe
ww.
Sec 4.
Sec 4.
Bb
H متوقف مؤقتا
blackboard.kfupm.edu.sa/bbcswebdav/pid-1457867-dt-content-rid-17379081_1/courses/24735.202020.LAB/ICS104-Project.pdf a
E نظام نور: . . .- EduWave
WhatsApp Webweb..
منصة مدرستي. . .scho o
Google hils
رجوع الى الصفحة الر. . . Gmail M
التطبيقات
YouTube
| +
100%
5 / 5
ICS104-Project.pdf
.LlgGITNyl1.כיק uacei תIGHLuaסasmiCtuנתםו
Options 5. Add New Patient
To implement Option 5, search the text-file for the PatientID of the record to be added. If the PatientID
exists, display an error; otherwise append the new record to the end of the text-file.
Page 4 of 5
Options 6. Delete Patient
To implement option 6, search the text-file for the PatientID and deleted the patient when found. If the
PatientID does not exist, display an error.
Note:
Use the clause throws FileNotFoundException or throws IOException for each method that
performs File I/O.
You must not share code with another project group. Doing so will result in a zero grade for all
groups involved.
09:41 e
O Type here to search
日
w
a 4) P ENG
ET/-9/1•
II
Transcribed Image Text:b. الدرجار dazjj * Regist O Questi C Woroj C Questi C Get Hc C Could C whats O Sec 4. Bb Bb ICS104 Bb X ICS Bb Uploac Bb Answe ww. Sec 4. Sec 4. Bb H متوقف مؤقتا blackboard.kfupm.edu.sa/bbcswebdav/pid-1457867-dt-content-rid-17379081_1/courses/24735.202020.LAB/ICS104-Project.pdf a E نظام نور: . . .- EduWave WhatsApp Webweb.. منصة مدرستي. . .scho o Google hils رجوع الى الصفحة الر. . . Gmail M التطبيقات YouTube | + 100% 5 / 5 ICS104-Project.pdf .LlgGITNyl1.כיק uacei תIGHLuaסasmiCtuנתםו Options 5. Add New Patient To implement Option 5, search the text-file for the PatientID of the record to be added. If the PatientID exists, display an error; otherwise append the new record to the end of the text-file. Page 4 of 5 Options 6. Delete Patient To implement option 6, search the text-file for the PatientID and deleted the patient when found. If the PatientID does not exist, display an error. Note: Use the clause throws FileNotFoundException or throws IOException for each method that performs File I/O. You must not share code with another project group. Doing so will result in a zero grade for all groups involved. 09:41 e O Type here to search 日 w a 4) P ENG ET/-9/1• II
b.
الدرجار
dazjj * Regist O
Questi C Woroj C
Questi C Get Hc C
Could C whats O
Sec 4.
Bb
Bb
ICS104 Bb
X ICS Bb
Uploac Bb
Answe
ww.
Sec 4.
Sec 4.
Bb
H متوقف مؤقتا
blackboard.kfupm.edu.sa/bbcswebdav/pid-1457867-dt-content-rid-17379081_1/courses/24735.202020.LAB/ICS104-Project.pdf a
E نظام نور: . . .- EduWave
WhatsApp Webweb...
منصة مدرستي. . .scho o
Google hils
رجوع الى الصفحة الر. . . Gmail M
التطبيقات
YouTube
| +
100%
1 / 5
ICS104-Project.pdf
ID_ProjectGroupNumber.zip
Question:
You are to develop a health management system that tracks the weight of patients visiting KFUPM
Clinic. The system administrator should be able to view the weight, the average weights and the number
of visits of each patient.
The system should have the following functions (all the functions are explained in this document);
main( )
getWeight(weight)
getAllPatientRecord( )
getPatient(patientID)
update(patientID, weight)
addPatient(Name, patientID)
deletePatient(patientID)
Implement a well-structured Python program that uses the functions listed above. The system should
enable the KFUPM Clinic's System Administrator to maintain Patient's weight. The information is
kept in a text-file of the form:
Patient ID
Patient Name
Weight Ave. Weight Visits
1007
Ahmad Said
51.5
51.5
1
Fatima Hassan
Suleiman Wasim
1004
80.1
80.1
1
1003
25.5
25.5
1
Majed Sameer
Muhammad Adel
Muhsim Zuheir
Aisha Abdullatif
1002
18 .6
18 .2
2
1006
81.2
81.2
1
1005
1001
86.7
86.7
1
10.1
10.1
1
where each line of the text-file contains a unique patient ID, the patients’ first and second names, his/her
weight during the visit, his/her average weight and their number of visits.
Your main ( ) program must have the following main menu:
1. Display all Patient Record
2. Display the Record of a particular Patient
3. Display all Patient Weight
4. Undate Patient
09:41 e
O Type here to search
w
a 4) P ENG
Transcribed Image Text:b. الدرجار dazjj * Regist O Questi C Woroj C Questi C Get Hc C Could C whats O Sec 4. Bb Bb ICS104 Bb X ICS Bb Uploac Bb Answe ww. Sec 4. Sec 4. Bb H متوقف مؤقتا blackboard.kfupm.edu.sa/bbcswebdav/pid-1457867-dt-content-rid-17379081_1/courses/24735.202020.LAB/ICS104-Project.pdf a E نظام نور: . . .- EduWave WhatsApp Webweb... منصة مدرستي. . .scho o Google hils رجوع الى الصفحة الر. . . Gmail M التطبيقات YouTube | + 100% 1 / 5 ICS104-Project.pdf ID_ProjectGroupNumber.zip Question: You are to develop a health management system that tracks the weight of patients visiting KFUPM Clinic. The system administrator should be able to view the weight, the average weights and the number of visits of each patient. The system should have the following functions (all the functions are explained in this document); main( ) getWeight(weight) getAllPatientRecord( ) getPatient(patientID) update(patientID, weight) addPatient(Name, patientID) deletePatient(patientID) Implement a well-structured Python program that uses the functions listed above. The system should enable the KFUPM Clinic's System Administrator to maintain Patient's weight. The information is kept in a text-file of the form: Patient ID Patient Name Weight Ave. Weight Visits 1007 Ahmad Said 51.5 51.5 1 Fatima Hassan Suleiman Wasim 1004 80.1 80.1 1 1003 25.5 25.5 1 Majed Sameer Muhammad Adel Muhsim Zuheir Aisha Abdullatif 1002 18 .6 18 .2 2 1006 81.2 81.2 1 1005 1001 86.7 86.7 1 10.1 10.1 1 where each line of the text-file contains a unique patient ID, the patients’ first and second names, his/her weight during the visit, his/her average weight and their number of visits. Your main ( ) program must have the following main menu: 1. Display all Patient Record 2. Display the Record of a particular Patient 3. Display all Patient Weight 4. Undate Patient 09:41 e O Type here to search w a 4) P ENG
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY