Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify your program 1 (using this: https://www.chegg.com/homework-help/questions-and-answers/task-write-java-program-reads-processes-four-blood-sugar-test-readings-one-day-program-ask-q24608671) so that it will handle multiple days of blood sugar test readings. Your program #2 should ask the

Modify your program 1 (using this: https://www.chegg.com/homework-help/questions-and-answers/task-write-java-program-reads-processes-four-blood-sugar-test-readings-one-day-program-ask-q24608671) so that it will handle multiple days of blood sugar test readings. Your program #2 should ask the user at runtime to supply the actual number of days readings they want to enter in the program for evaluation. In addition to producing the output specified in program 1 for each individual day, program 2 should also output the day (i.e. Day 1, Day 2, etc.) with the highest average blood sugar level, the day with the lowest average blood sugar level, and the overall average blood sugar reading over all days. All output should be displayed with meaningful descriptions. Like program 1, you should validate all numeric input from the user to ensure it falls in an appropriate range of values for the program to work correctly. You are also required to use nested FOR loops for this program.

(hint This program will require nested FOR loops. The outer loop will control the different days while the inner loop controls the test results for the current day. If you are having trouble understanding nested loops be sure to watch the live classroom from this week or the screen cast on nested loops in the module reading. Both of these work you through an example very similar to this program.)

Program 2 sample execution & output:

How many days of blood sugar test readings would you like to enter: 2

Enter data for day 1 Enter the blood sugar test reading for test 1: 180 Enter the blood sugar test reading for test 2: 202 Enter the blood sugar test reading for test 3: 121 Enter the blood sugar test reading for test 4: 350 Test Reading 4 had the highest blood sugar level with 350.0 mg/dL Test Reading 3 had the lowest blood sugar level with 121.0 mg/dL Your average blood sugar level for today was 213.25 mg/dL Enter data for day 2 Enter the blood sugar test reading for test 1: 132 Enter the blood sugar test reading for test 2: 225 Enter the blood sugar test reading for test 3: 199 Enter the blood sugar test reading for test 4: 150 Test Reading 2 had the highest blood sugar level with 225 mg/dL Test Reading 1 had the lowest blood sugar level with 132 mg/dL Your average blood sugar level for day 1 was 176.5 mg/dL

Overall Results:

Day 1 had the highest average blood sugar level with 213.25 mg/dL Day 2 had the lowest average blood sugar level with 176.5 mg/dL

Your average blood sugar over 2 days was 194.875 mg/dL

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

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions

Question

Knowledge of process documentation (process flow charting)

Answered: 1 week ago