I need help inserting a loop that will take me back to the main menu within each option. I also need a quit option in the main menu.
//This program has several options, first option calculates
//Body Mass Index, second option calculates Basal Metabolic Rate
//and the third option calculates how many macronutrients you should
//intake on a daily basis.
#include <iostream>
using namespace std;
void option1();
void option2();
void option3();
int main()
{
int option;
//Main Menu
cout << "There are three different options to chose from:" << endl;
cout << "Option 1 calculates your Body Mass Index (BMI)." << endl;
cout << "Option 2 calculates your Basal Metabolic Rate (BMR)." << endl;
cout << "Option 3 calculates your Macronutrients." << endl;
cin >> option;
cout << "Your Basal Metabolic Rate is " << BMR << "." << endl;
cout << "This amount of calories is what you need to intake on" << endl;
cout << "a daily basis to maintain weight." << endl;
}
void female()
{
int height;
int weight;
int age;
double BMR;
cout << "Please enter your height in inches." << endl;
cin >> height;
cout << "Please enter your weight in pounds." << endl;
cin >> weight;
cout << "Please enter your age." << endl;
cin >> age;
cout << "Thank you, now calculating your BMR ..." << endl;
cout << "Your Basal Metabolic Rate is " << BMR << "." << endl;
cout << "This amount of calories is what you need to intake on" << endl;
cout << "a daily basis to maintain weight." << endl;
system("pause");
}
//This option calculates how many calories you need to intake
//depending on your level of activity using your BMR calculated
//in option 2.
void male_macros();
void female_macros();
void option3()
{
int gender;
cout << "Please input your gender: 1 for male or 2 for female" << endl;
cin >> gender;
if (gender == 1)
{
male_macros();
}
else
{
female_macros();
}
}
void male_macros()
{
int weight;
int height;
int age;
double macros;
cout << "Please enter your height in inches." << endl;
cin >> height;
cout << "Please enter weight in pounds." << endl;
cin >> weight;
cout << "Please enter your age." << endl;
cin >> age;