Question
Answer in C code!!! Problems specification: You are required to use the fgets () function and related covered tools and techniques for all your input
Answer in C code!!!
Problems specification:
You are required to use the fgets() function and related covered tools and techniques for all your input and wherever they are needed.
The same diabetic research center wants you to develop an application that, not only keeps track of glucose reading for all patients, but be able to process all data stored in arrays. The application should display a report about all or given selected employee via a menu. Input consists of social security, first name, last name, age, weight, and glucose reading (if allowed because of fasting). Your output consists of all input for all patients and if needed for a selected patient. All processes are based on the following menu:
next for the menu and remaining specs
-1-Register a patient
-2-Display all patients
-3-Search for a patient
-4-Quit program
Your input consists of:
First: You are required to store all patients data in a set of 6 parallels arrays of 100 max entries each. You need an additional 7th array for the state of the patient glucose level:
-patient social security number (declared as an array of char)
-patient first name (declared as an array of char)
-patient last name (declared as an array of char)
-patient age (int)
-patient weight (int)
-patient glucose reading (dont enter glucose reading if patient is not fasting for more than 12 hours: need to check with patient first). (int)
An extra array storing the state of all patients and parallel with the six first arrays:
-patient state (did not fast, low glucose, normal glucose, high glucose: can be coded as int).
What to do?
---if user select -1- from the menu, call the input function, store all data in their related array, evaluate the patient store the related state in the corresponding array.
---if user select -2- from the menu, display all existing patients.
---if user select -3- search for a patient and if found display it.
Needed major functions:
-Code the menu listed above as a separate function.
-Code a single function for all of the input. If patient is not fasting, no glucose reading should occur and you should store a suitable value that indicates no reading ( a value of zero is not acceptable: think about this!)
-Code a function that evaluates the state of the glucose level (80-130 normal, less than 80 too low, over 130 too high, or not fasting)
-Code a function that displays all data about a given patient. The state must be displayed as a statement and not just a number. (refer to HW2 solution).
-Code a function that search for a patient and if found call the display function, otherwise display a statement to this effect.
-Code a function that calculates and displays the average glucose level of all existing patients.
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