I am trying to finish this code, if someone could be so kind to help me, I would be forever thankful.
#include <iostream>
#include <cmath>
using namespace std;
int getInput();
double getKilometers(double miles);
double getBMI(double weight, double height);
double getDistance(double x1, double x2, double y1, double y2);
double getTaylor();
int main()
{
bool check = true;
int choice;
double weight, height, BMI;
double miles, kilometers;
double distance, x1, x2, y1, y2;
do {
choice = getInput();
switch (choice) {
case 1:
cout << "Enter the number of miles: " << endl;
cin >> miles;
kilometers= getKilometers(miles);
// call your function
break;
case 2:
cout << " Enter body weight and height:" << endl;
cin >> weight >> height;
BMI= getBMI(weight, height);
// call your function
break;
case 3:
cout << "Enter x1, y1, and x2, y2:" << endl;
cin >> x1 >> y1 >> x2 >> y2;
distance= getDistance(x1,x2,y1,y2);
// call your function
break;
case 4:
// call your function
break;
case 5:
cout << "End of Program.\n";
check = false;
break;
default:
break;
cout << "You have selected the" << choice << " option /n";
}
} while (check);
return 0;
}
// ******************* END OF MAIN **************************
int getInput()
{
int choice;
cout << endl
<< " 1. Miles to Kilometers \n"
<< " 2. BMI \n"
<< " 3. Distance Between Two Points\n"
<< " 4. Taylor Series \n"
<< " 5. Quit /n"
<< " Enter an operation number: ";
cin >> choice;
return choice;
}
double getKilometers(double miles)
{
//cout << rint(miles) << " Miles is " << rint(miles ∗ 1.609344) << " Kilometers" << endl;
return (miles ∗ 1.609344);
}
double getBMI(double weight, double height)
{
//cout << "The calculated BMI is " << (weight * 703)/pow(height, 2) << endl;
return (weight * 703)/pow(height, 2);
}
double getDistance(double x1, double x2, double y1, double y2)
{
//cout << " The distance is" << sqrt(pow((x1-x2),2)+pow((y1-y2),2)) << endl;
return sqrt(pow((x1-x2),2)+pow((y1-y2),2));
}
double getTaylor()
{
double estimation;
cout << "Enter the values for x and n:" << endl;
cin >> x >> n;
cout << "Taylor series estimation is" <<
}
Here is a link to the problem:
https://1b5d0a36-a-62cb3a1a-s-sites.googlegroups.com/site/cs102utk/Lab6.pdf?attachauth=ANoY7cqlGaWDt0BDXDA9usjOUZ7EWoXSeaVqhBskQFyTye2ST4EADoUZNlphvb5TIjAhRTl-RShyiYj6oOD4tJXBAeR1OQ4aCSggdT08KNVK2prSsdmU41KypBtZ_1ccJAANXLYRvat2QuX8-FBL5RQCoiOTJX62HYJy03F6qP9Z5FYTSMEwruW5tiI8oCBimN29OQ6lgjk0&attredirects=0