In this exercise, you will create a program that displays the number of daily calories needed to maintain your current weight. The number of calories is based on your gender, activity level, and weight. The formulas for calculating the daily
In this exercise, you will create a program that displays the number of daily calories needed to maintain your current weight. The number of calories is based on your gender, activity level, and weight. The formulas for calculating the daily calories are shown in Figure 6-44.
a. Create an IPO chart for the problem, and then desk-check the algorithm using the test data included in Figure 6-44. Also desk-check it using invalid data, such as X as the gender code, K as the activity code, or a negative number for the weight.
b. List the input, processing, and output items, as well as the algorithm, in a chart similar to the one shown earlier in Figure 6-27. Then code the algorithm into a program.
c. Desk-check the program using the same data used to desk-check the algorithm.
d. If necessary, create a new project named Intermediate15 Project and save it in the Cpp8\Chap06 folder. Enter your C++ instructions into a source file named Intermediate15.cpp. Also enter appropriate comments and any additional instructions required by the compiler.
e. Save and run the program. Test the program using the same data used to deskcheck the program.
Moderately active female: total daily calories = weight multiplied by 12 calories per pound Relatively inactive female: total daily calories = weight multiplied by 10 calories per pound Moderately active male: Relatively inactive male: total daily calories = weight multiplied by 13 calories per pound total daily calories = weight multiplied by 15 calories per pound Gender F Activity Weight 150 120 180 200 F M A M A Figure 6-44
This problem has been solved!
- Tutor Answer
IPO chart information Input gender F or M activity level A or I weight Processing none Output calori…View the full answer

Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell
Students also viewed these Computer science questions