| OP: float getAmount() float amount; bool isValid; float amount = inputAmount(); bool isValid = isValidAmount(amount); while(!isValid) { cout << "Error Message"; amount = inputAmount(); isValid = isValidAmount(); } return amount; |
float getAmount(), or alternatively missing a { and a } if this intended to be a function definition. In which case, this level of C++ is way beyond you and you should go back to the beginning.amount and isValid are declared twice.