Return to course web page: [James Tam] | Return to course web page: [Nathaly Verwaal] |
Due October 21 at 4 PM
Each day a person takes in calories through nutrients. Calories are expended through normal metabolism needed to keep the body functioning (e.g. sleeping, breathing, sitting, walking etc.) and through more strenuous activities (e.g. running, exercise etc.). The difference between calories taken in and expended can be used to determine if body mass increases or decreases over time.
The computation for calories expended is different for men and women. You will create an application for either men or women (your choice) that computes the amount of calories expended based on the users input.Calories expended during normal metabolism
A formula can be used to determine daily calories expended during regular daily activities is derived by Mifflin et. al 1990.1 For this assignment we'll used the simplified version of this formula (which is equally accurate according to the authors of the paper). The formulas for each gender is as follows.
Before
After (use this one, a small change in the bracketing produces a slightly different result)
Weight = weight in kilograms (1 pound = 0.45359237
kilograms)
Height = height in centimeters (1 inch = 2.54 centimeters)
Age = age in years
Potentially any of these values can be integer or real numbers (e.g. 63 kilograms, 32.5 years).
Calories expended while working out
Although there have been ways of estimating calories expended while working out e.g., walk = 200 calories per hour, jog = 400, run = 800 etc. important factors such as body mass and age have largely been left out. Furthermore the workout intensity has been largely left to imprecise estimates (exactly what speed constitutes a jog vs. a run).
A more precise method of determining calories expended while working out was derived by Keytel et al 20052. There is a different formula used for each gender:
Before
Age = age in years
Weight = weight in pounds
Heart rate = average heart rate (beats per minute) while working out
Time = workout duration in minutes
Again any of these values can be integer or real numbers.
You need to write a program that will prompt the user to enter all information needed to compute their caloric expenditure for an average day. Consider the formulas above to see what information you need from the user. Note that total caloric expenditure is the sum of the calories expended during normal metabolism and the calories expended while working out.
Make sure you ask the user for the information in measurements that they are most likely to know. For example, most people in Canada know their weight in pounds, not in kilograms.
The output of your program should be neat and presentable and the program should round fractional values to one fractional digit e.g., 100.55 is displayed as 100.6.
You also keep in mind that your program needs to be decomposed into functions. Not only will you be marked on functionality (does the program implement the above features) but part of your grade for this assignment will be determined by: how logical and balanced is your decomposition (i.e., your program should not just consist of one 'super function' that implements most of the program's functionality), and how well designed are your functions (e.g., a function should implement one well defined task). For additional details principles of good design of functions see the lecture/course notes provided by your instructor.