First, if you press the <> button to the right of your post, it will make code tags. Code is easier to read in code tags. I could also give you line numbers to point things out.
ValidateNumbers() only accepts two arguments, but you pass it three in your while loop.
ValidateNumbers returns void, but you do numberValid = ValidateNumbers(hours,0.00,112.00);.
FALSE isn't part of standard c++, use false instead (notice what the tags did?). numberValid is an int, so you can't give it false anyway.
So I think to start, make numberValid a bool, and have ValidateNumbers return bool.
That function is pretty crazy in general though. It doesn't really do anything.
Is ValidateNumbers a different function? Provide the code for it as well, so it will be possible to see what is going wrong. Please use the code tags for code.
One more thing: you do not increase the retryCount within the loop.
Pass the arguments by reference: void validateNumbers(float& hours,float& payrate)
Here's the code for payrate:
1 2 3 4 5 6 7 8 9 10 11 12 13
float maxPayrate = 99.99f;
printf(" Enter the payrate ==> ");
do
{
int scanSuccess = scanf("%f",payrate);
if (scanSuccess != 1)
printf("Not a number, please try again: ");
elseif (payrate > maxPayrate)
printf("Value must be less than %6f, please try again", maxPayrate);
// Also maybe if payrate was less than zero
}
while (scanSuccess != 1 || payrate > maxPayrate);