Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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 0 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. The program MUST be in procedural programming style to gain marks. It must use loops, records, methods and arrays. For high marks the program should correctly implement the above, and be well-structured using methods that take arguments and return results, with at least one clearly defined abstract data type. It should have very good style in all other ways (such as indentation, spacing, naming, etc). ii) Explain briefly in your own words (separately from the code, in the box provided) how one important method of your program answering part i) works. It should be a method specific to this program and not, for example, a generic method provided for you such as a generic input method. [10 marks]

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

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions

Question

=+write, or speak a foreign language?

Answered: 1 week ago

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago