帮忙写一个Dev C++

来源:百度知道 编辑:UC知道 时间:2024/05/21 10:56:37
1. Basal metabolic rate: Calories required = 70 * (P / 2.2)^0.756
2. Physical activity: Calories required = 0.0385 * Intensity * P * Minutes
Here, Minutes is the number of minutes spent during the physical activity, and intensity is a number that estimates the intensity of the activity. Here are some sample numbers for the range of values:

Activity Intensity
Running 10mph 17
Running 6 mpg 10
Basketball 8
Walking 1 mph 1

3. Energy to digest food: Calories required = TotalCaloriesConsumed * 0.1
In other, 10% of the calories we consumer goes towards digestion.

Write a function that computes the calories required for the basal metabolic rate, taking as input a parameter for the person's weight. Write another function that computes the calories required for physical activity, taking as input para

#include <cstdlib>
#include <iostream>
#include <cmath>

using namespace std;
double calories_required_for_the_basal_metabolic_rate(double);
double calories_required_for_physical_activity(double, double, double);
int main(int argc, char *argv[])
{
double weight, intensity, minutes, servings;
cout << "Please input the weight:" << endl;
cin >> weight;
cout << "Please input the intensity of physical activity:" << endl;
cin >> intensity;
cout << "Please intput the numer of minutes spent performing the physical activity:" << endl;
cin >> minutes;
servings = (calories_required_for_the_basal_metabolic_rate (weight)
+ calories_required_for_physical_activity (intensity, weight, minutes)) / .1;
cout << "Servings of that food should be eaten per