Question: Write a complete program (should include directive, namespace, and the main program). The program prompts the user to enter the ac1_test result and then calls
Write a complete program (should include directive, namespace, and the main program).
The program prompts the user to enter the ac1_test result and then calls the diabetes function defined in the question above (question #22) to get diagnoses and determine the treatment plan. if the diagnosis is normal program displays "You are healthy!", if the diagnosis is prediabetes program displays "Need to diet and exercise!", and if the diagnosis is diabetes program displays "Start medication treatment".
the output would look like this:
Enter ac1_test results
6.4
Need to diet and excercise!
Enter ac1_test results
5.4
You are healthy!
Enter ac_1 test results
6.8
Start medication treatment!
Write function prototype and function definition.
Type 2 diabetes diagnosed using the glycated hemoglobin (A1C) test. This blood test indicates you average blood sugar level for the past two to three months. Results are interpreted as follows:
ac1_test. diagnosis
Below 5.7%. normal
5.7% to 6.4%. prediabetes
6.5% or higher. diabetes
Function diabetes takes one parameter of type double named ac1_test. Based on the table above, the function determines the diagnosis and returns it as a string value.
PLEASE ANSWER FOR GOOD REVIEW!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
