C++ help: Could you explain step-by-step what to do? It would be very helpful. T
ID: 3704995 • Letter: C
Question
C++ help: Could you explain step-by-step what to do? It would be very helpful.
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 x0.05741)+ (Heart Rate x 0.4472) 20.4022] x Time/4.184 Given age (years), weight (pounds), heart rate (beats per minute), and time (minutes), output calories burned for men and women. If the input is 49 155 148 60, the output is Men: 489.777 calories Women: 580.94 calories ACTIVITY 2.21.1: CH2 LAB: Expression for calories burned during workout 0/10 main.cpp Load default template... 1 #include 2using namespace std 4int main) 6 Type your code here. return e; 10Explanation / Answer
#include <iostream>
using namespace std;
int main()
{
int age = 49, weight = 155, heartRate = 148, time = 60;
double menCal = (age * 0.20117 - weight * 0.09036+heartRate * 0.6309-55.0969) * time /4.184;
double womenCal = (age * 0.074 - weight * 0.05741+heartRate * 0.4472-20.4022) * time /4.184;
cout<<"Men: "<<menCal<<endl;
cout<<"Women: "<<womenCal<<endl;
return 0;
}
Output:
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.