borrowbreadcat / borrowbreadcat/userYesNo
while statement every time
- Dominant language
- C++
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
using userYesNo() properly requires the coder to write a while statement every time. This is repetitive, and probably easily fixable!
I originally made it this way because I needed the question the user is confirming to be changeable. The coder has to use userYesNo() like this every time:
`
bool repeat {true};
int userInput { 0 };
while (repeat == true)
{
cout << "ask the question here \n";
cin >> userInput;
repeat = userYesNo();
}
`
So I think I can get in there and make it so that userYesNo() calls for a function parameter `str question` allowing the whole while statement to be inside the userYesNo.cpp.
In my vision, the coder should only have to write
`
userYesNo("What is your age")
`
or something like that. I am seeing potential issue where we're trying to figure out how let the function return the answer to the question, perhaps no matter the value type?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.