| I was just trying to avoid cluttering the board. :)
Well...there are a coupla issues here:
1. I assume you have an hours member of your class. If you do, then the problem line should read
hours = h;
or
this->hours = h;
The way you have it, a temporary variable named "hours" in your function is being used, and no class member data is being changed.
2. Your design of prompting the user for a valid hours value if the parameter is invalid is...odd, to say the least. In such a case, standard procedure is to do error-checking in an input loop elsewhere (main, for example), and have the method assume its parameter is valid. |