[SOLVED] COP3223 Homework 2

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

You’ve decided that to combat the extra weight gain, you’re going to write a program with your new program

You’d like to keep track of how many calories you are consuming.
You are hoping that keeping track of this information will nudge you into making better food choices.
Luckily, the foods you eat are labeled with the number of grams of protein, carbohydrates and fat they cont

Program Setup:
Use these constants to represent the number of calories in each gram of protein, carbohydrates, and fat re

#define CALS_PER_GR_PROTEIN 4
#define CALS_PER_GR_CARB 4
#define CALS_PER_GR_FAT 9

Write a program that asks the user to enter the grams of protein, carbohydrates and fat that they consumed
Remember to create variables for these values, prompt the user for the information, and use the correct pe
Calculate the total number of calories consumed based on the constants and print the result for the user to

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.