In this exercise, you will create a program that displays the number of daily calories needed to

Question:

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. 

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


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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: