Question

2.24 LAB: Expression for calories burned during workout 2.24 LAB: Expression for calories burned during workout...

2.24 LAB: Expression for calories burned during workout

2.24 LAB: Expression for calories burned during workout

The following equations estimate the calories burned when exercising (source):

Women: Calories = ( (Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022 ) x Time / 4.184

Men: Calories = ( (Age x 0.2017) + (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969 ) x Time / 4.184

Write a program with inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output calories burned for women and men.

Output each floating-point value with two digits after the decimal point, which can be achieved by executing
cout << fixed << setprecision(2); once before all other cout statements.

Ex: If the input is:

49 155 148 60

the output is:

Women: 580.94 calories
Men: 891.47 calories

The lab is on zybooks and it is coded in c++ please help I'm stuck.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program:

   #include <iostream>
   #include<stdio.h>
   #include<iomanip>
   using namespace std;

   int main()
   {
      
       //variables to store the input
       int Age,Weight,Heart_Rate,Time;
      
       //gets the inputs from the user
       //cout<<"Enter Age, Weight, Heart_Rate and Time separated by a space:"<<endl;
       cin>>Age>>Weight>> Heart_Rate>>Time;
       cout<<endl;
      
      
       //computes and displays calories for women
       cout << fixed << setprecision(2);
       cout<<"Women: "<<((Age*0.074)-(Weight * 0.05741)+(Heart_Rate*0.4472)-20.4022)*Time/4.184<<" Calories "<<endl;
      
      
       //computes and displays calories for men
       cout<<"Men: " <<((Age*0.2017)+(Weight*0.09036)+(Heart_Rate*0.6309)-55.0969)*Time/4.184 <<" Calories "<<endl;
      
       return 0;
   }

Output:

Add a comment
Know the answer?
Add Answer to:
2.24 LAB: Expression for calories burned during workout 2.24 LAB: Expression for calories burned during workout...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2.18 LAB: Calories burned during workout (expressions) Programming Language : JAVA The following equations estimate the...

    2.18 LAB: Calories burned during workout (expressions) Programming Language : JAVA The following equations estimate the calories burned when exercising (source): Men: Calories = [(Age x 0.2017) — (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969] x Time / 4.184 Women: Calories = [(Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022] x Time / 4.184 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes)....

  • In Java The following equations estimate the calories burned when exercising (source): Women: Calories = (...

    In Java The following equations estimate the calories burned when exercising (source): Women: Calories = ( (Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022 ) x Time / 4.184 Men: Calories = ( (Age x 0.2017) + (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969 ) x Time / 4.184 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output calories burned for...

  • In C please!: The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0....

    In C please!: The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0.2017) — (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969 ) x Time / 4.184 Women: Calories = ( (Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022 ) x Time / 4.184 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output calories burned...

  • 4. Perform a SWOT analysis for Fitbit. Based on your assessment of these, what are some strategic options for Fitbit go...

    4. Perform a SWOT analysis for Fitbit. Based on your assessment of these, what are some strategic options for Fitbit going forward? 5. Analyze the company’s financial performance. Do trends suggest that Fitbit’s strategy is working? 6.What recommendations would you make to Fitbit management to address the most important strategic issues facing the company? Fitbit, Inc., in 2017: Can Revive Its Strategy and It Reverse Mounting Losses? connect ROCHELLE R. BRUNSON Baylor University MARLENE M. REED Baylor University in the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT