1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
#include <iostream>
#include <cmath>
using namespace std;
void displayDescription(); //displays greeting to user
void caloriesDIGESTION();//calculates the calories required for digestion
void caloriesreqBASAL(); //calculates basal metabolic rate
void caloriesreqPHYSICAL(); //calculates calories used for physical activity
double caloriesNEEDED(double);//calculates calories needed to main body weight
void displayRESULT();//displays the result of calories needed to user
int main()
{
//variable declarations
double lbs, physicalActivity, calories, caloriesREQ, minutes, totalCal;
double const caloriesREQdigest= calories * 0.1;
//display greeting
displayDescription();
//Get informaton from user
cout << "How much do you weigh in lbs? \n";
cin>>lbs;
cout << "\nPlease estimate the intensity of your workout \n"
<< "(Ex. Running @10 MPH=17, Running @ 6PMH=10, Basketball=8, & Walking=1): \n";
cin>> physicalActivity;
cout << "\nHow long (in minutes) do you perform this physical activity?\n";
cin>> minutes;
//displays result to user
displayRESULT(totalCal);
return 0;
}
void displayDescription()
{
cout <<"Hello, this program will allow you to calculate how many servings of a \n"
<<"certan food you need to intake to maintain your body weight \n\n";
}
void caloriesreqBASAL()
{
double lbs, caloriesREQbasal, weight;
caloriesREQbasal= 70.0 * pow((weight/2.2), 0.756 );
}
void caloriesreqPHYSICAL()
{
char running;
double lbs, caloriesREQphysical, physicalActivity, intensity, minutes, mph;
caloriesREQphysical= 0.0385 * intensity * lbs * minutes;
cout<< "What kind of physical exercise did you do today?";
cin>>physicalActivity;
}
void caloriesDIGESTION()
{
double caloriesREQdigestion, calories;
caloriesREQdigestion= calories*0.1;
}
double caloriesNEEDED()
{
double totalCal, caloriesREQdigestion, caloriesREQbasal, caloriesREQphysical;
totalCal = caloriesREQbasal + caloriesREQphysical + caloriesREQdigestion;
return totalCal;
}
void displayRESULT(double totalCal)
{
//displays the amount of calories needed
cout << "The total amount of calories needed to maintain your body weight is: ";
}
|