the program itself works well; however, only for works, the other does not execute. Yet i do not want the loop to showChoices(); during the for loop. What i really want to know is why the second for does not execute.
showChoices();
cin >> choice; // this for executes
}
else if (choice == 2)
{
system("cls");
celsiusToFahrenheit(celsius, fahrenheit);
system("cls");
cout << "CONVERSION COMPLETE!" << endl;
cout << endl;
cout << "Celsius Degrees: " << celsius << endl;
cout << endl;
cout << "Fahrenheit Degrees: " << fahrenheit << endl;
} // this for does not
else
{
system("cls");
cout << "Unfortunatly this is not a choice, please try again!" << endl;
showChoices();
}
}
system("pause");
return 0;
}
void showChoices()
{
cout << setfill('*') << setw(37) << "*" << endl; //creates a decorative line consisting of only *
cout << setw(10) << "Welcome to the Temparature Converter!" << endl;
cout << setfill('*') << setw(37) << "*" << endl;//creative boarder
cout << endl;
cout << endl;
cout << "To convert Fahrenheit to Celsius press 1." << endl;
cout << endl;
cout << "To convert Celsius to Fahrenheit press 2." << endl; //give the user the options they have in this program
cout << endl;
cout << "To Stop the program press 99." << endl;
cout << endl;
cout << "What is your choice? ";
}
void fahrenheitToCelsius(double& fahrenheit, double& celsius)
{
system("cls");// clears the screen