One way to measure the amount of energy that is expended during exercise is to use metabolic equivalents (MET). Here are some METS for various activities;

Running 6 MPH: 10 METS

Basketball: 8 METS

Sleeping: MET

The number of calories burned per minute may be estimated using the formula

Calories/Minute= 0.0175 X MET X Weight (Kg)

Write a program that inputs a subject's weight in pounds, the number of METS for an activity, and the number of minutes spent on that activitym and then outputs an estimate for the total number of calories burned. One kilogram is equal to 2.2 pounds.

Get weight value from user.
Get MET score for activity.
Get time spent doing activity.
Output (0.0175 * MET * time * weight/2.2)

Which of those can you not do?

Edited 4 Years Ago by Moschops: n/a

Please read the rules here.

7. Do not ask for code. We are not a coding service. We will help you fix your code.
If anyone posts a complete working solution for you, they are enabling cheaters.
If you use that code you are a cheater.

We can help you to show the path but you should write your own code. If you face any problem regarding your code you can share it. If you don't know coding you can learn it. Here are some reference books. You can find lots of free books and video tutorial for coding. If you ask for code that will not help you to learn How to Code.

I'll take that to mean you don't know how to take in the weight value from the user. This is, as a general rule, one of the first things in the textbook or class notes. Here is how to get a value from the user:

cin >> someVariable;

If you are trying to prompt user for data, try this.

cout<<"please enter your data here";
cin>>dataVariable;
#include <iostream>
using namespace std;

int main()
{
    int mets;
    double fatnessKg, fatnessLb, energy, mins;

    cout << "METS:\n"
         << "\tRunning: 6Mph = 10 METS\n"
         << "\tBasketball: 8 METS\n"
         << "\tSleeping: MET\n";



    system ("pause");
    return 0;
}

Edited 3 Years Ago by Dani: Formatting fixed

#include <iostream>

using namespace std;

int main()
{
   double CAL,MET,MINS,WEI;
   
   CAL = MET = MINS = WEI = 0;

   cout<<"Enter you weight in pounds:";
   cin>>WEI;
  
   cout<<"Enter MET number:";
   cin>>MET;

   cout<<"Enter the duration in mins:";
   cin>>MINS;

   CAL = 0.0175 * MET * WEI/2.2;
   CAL = CAL * MINS;
   cout<<"Total Calories:"<<CAL<<endl;


   return 0;


}
This article has been dead for over six months. Start a new discussion instead.