case 'f':
case 'F':
do
{
cout << "Enter Finish Time (Max Start + 24h, 0-23:59): ";
cin >> FinishTime;
if (FinishTime > 2359)
{
do
{ cout << "Error! Invalid Finish Time Input." << endl
<< "Enter Finish Time (Max Start + 24h, 0-23:59): ";
cin >> FinishTime;
} while (FinishTime > 2359);
}else
if (FinishTime == "q")
{
menu();
}else
if (FinishTime < 2400)
{
cout << "Yacht Time: ";
HoursConv(StartTime, FinishTime);
cout << " hours, Yacht Avg Speed: "
<< AverageSpeed(CourseDistance, StartTime, FinishTime)
<<" knots, " << SpeedConv(AverageSpeed(CourseDistance, StartTime, FinishTime)) << " km/h" << endl;
}
} while (FinishTime != "q" || FinishTime != "Q");
break;
I can't get my function to call another function if the user input is "q" or "Q". if the user input is a "q" or any other things that aren't a number, the loop goes forever and ever. What I need is when the program asks for a user input in this case in a switch case and the user input is a "q" or "Q", the function will call my menu function and bring up the menu again. If the user input isn't a "q" or "Q", just an ordinary number, then it'll go ahead and calculate everything eg.averagespeed, etc.
Thank you!! It's driving me nuts!