Retrieved de https://studentshare.org/logic-programming/1676039-calorie-management
https://studentshare.org/logic-programming/1676039-calorie-management.
Data on the input variable, Y, is obtained from the calorific calculator and is known to be affected by age, gender, body activities, weight as well as the height of the person (Klingensmith & American Diabetes Association, 2003). The final step involves making a comparison based on the analyzed data from the two input caloric. The comparison will present two important cases: 1. Where X=Y, the program will indicate a balance between the calories, and this simply means that there are no pounds or ounces gained or lost. 2. Where the value of the X variable exceeds the value of Y, then we should compute other explanatory variables M, N, and O.
Where: M= X-Y, N=M/K, and O=N, and K is a constant figure valued at 3500. M, therefore, explains a case where more calories are taken in than expended while N-pounds or O-ounces might have been gained.3. Where the value of the Y variable is greater than X, we again compute M, N, and O to act as our explanatory variables. With this regard, M=Y-N, N=M/K while O=N. M=Y-X means that the individual expands more calories than he/she consumes whereas N-pounds and O-ounces might have been lost. All the data and information on that particular individual are then stored in the computer memory to help monitor the person’s health standards in a given period.
Flowchart for the algorithm Algorithm in pseudocode for the tasks and subtasks Define variables, YDefine MN=M/3500O=N/16Start the program enter the value of XEnter the value of compare the values of X and Y X>Y, compute M=X-YCompute N=M/3500O=N*16Print “more calories consumed than expected” ElseCompare X and YIf X=YPrint “calories balanced” Else compare X and YIf X
Read More