Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c) i) A patient suffering from asthma needs to keep a diary of their peak flow breathing readings. This is just a number between 0
c) i) A patient suffering from asthma needs to keep a diary of their peak flow breathing readings. This is just a number between 0 and 800 measuring how well they can blow air from their lungs. Their peak flow reading is the greatest of three readings taken at one time. Write a Java program to help the patient record their peak flow to show their doctor. The program should first ask the patient for the number their doctor has given them as being a dangerous reading. Any peak flow reading recorded that is less than the danger level should lead to a message that they need to go to hospital immediately. Once entered, this value should not be changed. After storing this number, the program should go into a loop that only stops when they type O instead of a day. It should repeatedly ask them for the day of the month which is a number from 1 to 31 (they may skip days) and then the three readings taken that day. All the peak flow readings (ie the largest of each set of three readings) should be stored. Worryingly low peak flow readings should lead to warning messages printed as noted above. Once O is typed, the program should print the pairs of the day and reading in the order entered as well as storing them in a file to show to the patient's Doctor. After doing so the program should end. Each entry, consisting of the day and reading, should be printed/stored on a new line. The day and reading should be separated by a comma (ie CSV / comma separated values format). You may assume that the report is needed at least once per month so there are never more than 31 readings to be stored
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started