Write a program that reads multiple blood sugar rates for a patient for multiple visits to a hospital and stops reading when the user enters a negative number or zero. While reading blood sugar rates, if any rate is outside the range 2.5-15.0 print the range followed by the message "is critical". After reading all the rates, the program is required to print the average rate and the number of critical cases. See sample input/output on the right side

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.7: Do While Loops
Problem 2E: (Misc. application) a. Write a program that continuously requests a grade to be entered. If the...
icon
Related questions
Question
Question 2
SAMPLE INPUT/OUTPUT
Enter sugar rates (negative or zero to stop)
Write a program that reads multiple blood sugar rates for a
patient for multiple visits to a hospital and stops reading when
the user enters a negative number or zero. While reading blood
sugar rates, if any rate is outside the range 2.5-15.0 print the
range followed by the message "is critical". After reading all the
rates, the program is required to print the average rate and the
number of critical cases. See sample input/output on the right
17.4 6.7 5.8 1.5 9.3 0
17.4 is critical
1.5 is critical
Average = 8.14
Critical = 2
side
Transcribed Image Text:Question 2 SAMPLE INPUT/OUTPUT Enter sugar rates (negative or zero to stop) Write a program that reads multiple blood sugar rates for a patient for multiple visits to a hospital and stops reading when the user enters a negative number or zero. While reading blood sugar rates, if any rate is outside the range 2.5-15.0 print the range followed by the message "is critical". After reading all the rates, the program is required to print the average rate and the number of critical cases. See sample input/output on the right 17.4 6.7 5.8 1.5 9.3 0 17.4 is critical 1.5 is critical Average = 8.14 Critical = 2 side
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning