12345678910111213141516171819202122232425
#include <iostream> #include <iomanip> using namespace std; int main() { float weightInPounds, mets, mins, totalCal, calPerMinute; const float poundToKilo = 2.2; const float formula = 0.075; cout << "Hello and Welcome to the Calorie Calculator!\n"; cout << "Please Enter Your Weight in Pounds: " << endl; cin >> weightInPounds; cout << "Enter the Number of METs For the Activity: " << endl; cin >> mets; cout << "Enter the Duration in Minutes: " << endl; cin >> mins; cout << fixed << setprecision (2); totalCal = formula * (weightInPounds / poundToKilo) * mets; totalCal = calPerMinute * mins; cout << "You burned an estimated " << totalCal << " calories." << endl; return 0; }
12
calPerMinute = formula * (weightInPounds / poundToKilo) * mets; totalCal = calPerMinute * mins;