Project for school

Hello everyone, I am in a Computer Science class where we deal with C++. For an assignment we need to use strings and such. But, anyways we are to use specific functions for our assignment and I am having trouble constructing a certain one.
The function is "PromptUserToFindLongestSequence" and what it does is ask the user if they want to find a longest sequence of numbers. The inputs are Y and N for yes and no. The function is supposed to re-prompt the user if their input is invalid, but I can't seem to construct this function. Can anyone give me some tips on how to build this function? Your tips will be much appreciated.
Use a do-while loop. For example

1
2
3
4
do
{
    // prompt a user to enter 'Y' or 'N'
} while ( /* The user answer is not equal to 'Y' or 'N' */ );
Last edited on
Thank you!
The name "PromptUserToFindLongestSequence" sound like you're asking (or reminding?) the user to find (as is, getting them to do the finding) the longest sequence! Not a good function name!
Last edited on
Topic archived. No new replies allowed.