For lab2, you will write a program that has
an interface that asks the user for information
about their cholesterol and their sex.
The C++ file should be called "lab2.cpp"
The interface of the program is like this:
What is your Low Density Lipoprotein (LDL) cholesterol, in mg/dL? 185
What is your High Density Lipoprotein cholesterol (HDL) in mg/dL? 45
What is your sex (M/F)? F
Your LDL is higher than the normal range (<=100 mg/dL is considered healthy).
Your HDL is lower than the healthy range for females (>=50 mg/dL),
Your LDL to HDL ratio is 4.1, which is above the healthy range (<=2.5 is considered healthy).
It is advisable to speak with a doctor if any of these values are outside the healthy range.
Alternative reports from the program would be:
Your LDL is in the healthy range (<=100 mg/dL is considered healthy).
Your HDL is in the healthy range for females (>=50 mg/dL is considered healthy).
Your LDL to HDL ratio is 2.2, which is in the healthy range (<=2.5 is considered healthy).
For practice writing functions, you are to have three functions:
- ldlTooHigh(int ldl) -- returns a bool value TRUE if the ldl level is too high, i.e., above 100.
-
hdlTooLow(int hdl, char sex) -- return bool value TRUE if the hdl level is too low: less than 40 for men and less than 50 for women.
- LdlHdlRatio(int ldl, int hdl) -- return bool value TRUE if LDL/HDL exceeds 2.5.
The command to "make" the executable (lab2x) is:
make lab2x
Do an "ls" to see that lab2x is in your directory. Test it.