> It simply asks for the feet and then the inches over and over.
1 2 3 4 5 6 7 8
|
char again ='Y';// Identify sentinel as the letter Y
while (again == 'y' || again == 'Y') // While loop to ask user if they would like to re-run program.
{
cout << "Please input the number of feet "; // Asking user for the number of feet
cin >> feet;
cout << "Please input the number of inches: "; //Asking user for the number of inches
cin >> inches;
}
|
that loop is in your main() function
notice that `again', the variable used in the condition, is not touched at all in the body of the loop
¿how do you expect the loop to end if the condition never changes?
> it's not doing the calculations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
int main()
{
char again ='Y';// Identify sentinel as the letter Y
while (again == 'y' || again == 'Y') // While loop to ask user if they would like to re-run program.
{
cout << "Please input the number of feet "; // Asking user for the number of feet
cin >> feet;
cout << "Please input the number of inches: "; //Asking user for the number of inches
cin >> inches;
}
{
cout << "\n\nTo run the program again enter y or Y)."; // Ask user if they would like to re-run the program
cin >> again ;
}
return 0;
}
|
that's your main function
¿where are you doing any calculation or calling any function?
1 2 3 4 5
|
float heightCalculating(int feet, float inches)
{
feet = meters * 0.03048;
centimeters = inches * 2.54;
}
|
one of your functions.
you promise to return a float, but there is no return statement (an error that you repeat in the other functions)
`feet' is a parameter passed
by value, any changes made to it will be local to this function
but your logic is egregious, you are trying to convert to meters, so it should be
meters = alpha*feet + beta*inches
also, avoid those global variables.