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 Weig

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

read the pictures first then this is the  remaining of the 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.

 

b Verify Email | bartleby
po ICS104-Project.pdf
+
O File | C:/Users/zyzal/OneDrive/šaJ120%zbw/ICS104-Project.pdf
O Amazon.co.uk – On..
O Booking.com
uli Dashboard | Grades..
Connect on a new I...
= KFUPM Resources
Other favourites
of 5
(D Page view
A Read aloud
V Draw
E Highlight
Erase
Your program must loop as long as the option 0 has not been selected. It must display an appropriate error
message if an invalid choice is entered. After executing each of the options 1 to 6, your program must
pause and display the message: “Press Enter key to continue . . .". Your program must display the main
menu after pressing the Enter key. Each of the options 1 to 6 must be implemented in a separate function
as mention earlier.
The other options must have the following behaviors:
Option 1: Display all Patient Record
It displays all the Patients' information recorded. The option must be implemented by reading directly
from the text-file where the data was saved. It then waits for the Enter key to be pressed before returning
control to the main menu. Below is a sample run:
飞IT
Please select your choice: 1
Weight Ave. Weight Visits
51.5
Patient ID
Patient Name
1007
Ahmad Said
51.5
1
1004
Fatima Hassan
80.1
80.1
1
1003
Suleiman Wasim
25.5
28.5
1002
Majed Sameer
Muhammad Adel
18 .6
15 .2
2
1006
81.2
81.2
1
1005
Muhsim Zuheir
86.7
88.7
2
1001
Aisha Abdullatif
10.1
10.1
1
Press Enter key to continue ...
17:53
O Type here to search
日
W
ENG
72
11/04/2021
of
2.
Transcribed Image Text:b Verify Email | bartleby po ICS104-Project.pdf + O File | C:/Users/zyzal/OneDrive/šaJ120%zbw/ICS104-Project.pdf O Amazon.co.uk – On.. O Booking.com uli Dashboard | Grades.. Connect on a new I... = KFUPM Resources Other favourites of 5 (D Page view A Read aloud V Draw E Highlight Erase Your program must loop as long as the option 0 has not been selected. It must display an appropriate error message if an invalid choice is entered. After executing each of the options 1 to 6, your program must pause and display the message: “Press Enter key to continue . . .". Your program must display the main menu after pressing the Enter key. Each of the options 1 to 6 must be implemented in a separate function as mention earlier. The other options must have the following behaviors: Option 1: Display all Patient Record It displays all the Patients' information recorded. The option must be implemented by reading directly from the text-file where the data was saved. It then waits for the Enter key to be pressed before returning control to the main menu. Below is a sample run: 飞IT Please select your choice: 1 Weight Ave. Weight Visits 51.5 Patient ID Patient Name 1007 Ahmad Said 51.5 1 1004 Fatima Hassan 80.1 80.1 1 1003 Suleiman Wasim 25.5 28.5 1002 Majed Sameer Muhammad Adel 18 .6 15 .2 2 1006 81.2 81.2 1 1005 Muhsim Zuheir 86.7 88.7 2 1001 Aisha Abdullatif 10.1 10.1 1 Press Enter key to continue ... 17:53 O Type here to search 日 W ENG 72 11/04/2021 of 2.
b Verify Email | bartleby
po ICS104-Project.pdf
+
O File | C:/Users/zyzal/OneDrive/šaJ120%zbw/ICS104-Project.pdf
O Amazon.co.uk – On..
O Booking.com
uli Dashboard | Grades..
Connect on a new I...
- KFUPM Resources
Other favourites
+
(D Page view
A Read aloud
V Draw
E Highlight
1
of 5
Erase
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
Ahmad Said
Fatima Hassan
Suleiman Wasim
1007
51.5
51.5
1
1004
1003
1002
1006
80.1
80.1
1.
25.5
25.5
Majed Sameer
Muhammad Adel
18 .6
18 .2
81.2
81.2
1
1005
Muhsim Zuheir
86.7
86.7
1.
1001
Aisha Abdullatif
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. Update Patient
5. Add New Patient
6. Delete Patient
0. Exit
Please select your choice:
Page 1 of 5
17:53
O Type here to search
日
디)
W
ENG
72
11/04/2021
of
Transcribed Image Text:b Verify Email | bartleby po ICS104-Project.pdf + O File | C:/Users/zyzal/OneDrive/šaJ120%zbw/ICS104-Project.pdf O Amazon.co.uk – On.. O Booking.com uli Dashboard | Grades.. Connect on a new I... - KFUPM Resources Other favourites + (D Page view A Read aloud V Draw E Highlight 1 of 5 Erase 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 Ahmad Said Fatima Hassan Suleiman Wasim 1007 51.5 51.5 1 1004 1003 1002 1006 80.1 80.1 1. 25.5 25.5 Majed Sameer Muhammad Adel 18 .6 18 .2 81.2 81.2 1 1005 Muhsim Zuheir 86.7 86.7 1. 1001 Aisha Abdullatif 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. Update Patient 5. Add New Patient 6. Delete Patient 0. Exit Please select your choice: Page 1 of 5 17:53 O Type here to search 日 디) W ENG 72 11/04/2021 of
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

it does not work can u send the file and re write the cade right 

Solution
Bartleby Expert
SEE SOLUTION
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