Question: Use Visual studio please and thank you Assignment Details: Each step below indicates a distinct task. Write code for each in main in a single

Use Visual studio please and thank you Assignment Details: Each step below indicates a distinct task. Write code for each in main in a single .c file, but separate the code for each with comments indicating which step the code is begin written for. Since we have not covered input in class yet, you will need to hard code values for all variables in each step. 1. Create an integer variable called varStep1 and set it equal to 16. Use compound assignment to divide varStep1 by 2, three separate times (that is to say, 16 will be divided by 2 three times). Use a printf statement to print to the screen: The result of the operations from step 1 is: X where X is the final value stored in varStep1. HINT: Run your code and do the math yourself to check your answer 2. The number of calories a person burns when exercising can be roughly estimated by the equation: Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) 75.4991 ) x Time / 8.368 Declare all five variables in this equation as doubles and code the above expression. Print to the screen: The number of calories burned was X where X is the result of the expression. Only print calories to 2 decimals. Assign the following values to the variables to check your work: Age = 22 Weight = 180 Heart Rate = 152 Time = 30 (Calories should be found to be 359.83) 3. Assume that eggs are packed in cartons of 12 egg each, and that cartons are packed in boxes that hold 20 cartons each. Declare the integer variables that you feel are necessary. Assume the number of eggs is a given value, and that cartons and boxes must be completely full. Code expressions to calculate the number of cartons necessary to hold the eggs and the number of boxes necessary to hold those cartons. In addition, use the modulus operator to determine the number of eggs that are leftover and the number of cartons that are leftover. Print your results to the screen. Test your code with 5619 eggs (should find that this number of eggs fits in 468 cartons and 23 boxes, with 3 eggs and 8 cartons leftover)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!