Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python: Iterations Using FOR and WHILE Assignment Problem 1A: Assign patients to nurses Write a program that: Prompts for the number of patients Prompts for

Python: Iterations Using FOR and WHILE Assignment

Problem 1A: Assign patients to nurses

Write a program that:

Prompts for the number of patients

Prompts for the number of nurses on the shift

Assigns an equal number of patients to the nurses at the beginning of the shift.

Lists the patients assigned to each nurse

If any patients are left over, a warning message should display indicating that the patient has not been assigned to a nurse.

Tip 1: You will need to decide which is more appropriate to use: FOR or WHILE

Tip 2: Most likely you will also need to use IF Tip 3: You will need to use the division operator and the modulo (remainder) operator.

Example output

Enter the number of patients: 7

Enter the number of nurses available for this shift: 3

Each nurse will be assigned 2 patients

Patients assigned for nurse no.1 are:

Patient 6

Patient 7

Patients assigned for nurse no.2 are:

Patient 4

Patient 5

Patients assigned for nurse no.3 are:

Patient 2

Patient 3

WARNING: 1 PATIENTS ARE NOT ASSIGNED TO A NURSE! Manual assignment required

Problem 1.B: Patients who need HgbA1C testing

Write a program that:

Collects the glucose reading for 5 different patients

Then produces a list of the patients who have a glucose reading above 120 mg/dl (and so need to have a HgbA1c test)

Tip 1: You will need to decide which is more appropriate to use: FOR or WHILE

Tip 2: You most likely will need to use IF / ELSE logic in addition to your FOR or WHILE

Example output

Enter patient no.1 reading in mg/dl: 326

Enter patient no.2 reading in mg/dl: 180

Enter patient no.3 reading in mg/dl: 98

Enter patient no.4 reading in mg/dl: 425

Enter patient no.5 reading in mg/dl: 76

3 patients need Hb1Ac testing:

Patient no.1

Patient no.2

Patient no.4

Problem 1.C: Monitor a patients temperature

Write a program that:

Specifies a critical temperature is greater than or equal to 103.0F

Specifies an elevated temperature is greater than or equal to 101.0F

Prompts for the patients temperature

As long as the temperature is greater than or equal to the critical temperature, display an alert.

As long as the temperature is greater than or equal to the elevated temperature, display an alert

Otherwise, display the message that the temperature is in normal range.

NOTE: The objective here is simply to have different messages that display at appropriate points.

Tip 1: You will need to decide which is more appropriate to use: FOR or WHILE

Example output

Enter the patient's temperature in degrees F: 104

The patient's temperature is critical; contact the physician.

(or)

Enter the patient's temperature in degrees F: 102.2

The patient's temperature is elevated. Give 2 Tylenol and recheck temperature.

(or)

Enter the patient's temperature in degrees F: 98.6

The patient's temperature is within expected range.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions