For those who remember, this is the function I'm having problems with:
bool in_range(int val, int min, int max)
{
bool ans;
int nscores;
while ((val >= min) && (val <= max))
{
cout << "Please enter exam score " << nscores << " : ";
cin >> val;
if ((val < min) || (val > max))
{
int y = 1;
int n = 0;
cout << endl << "Score out of range!" << endl << endl;
cout << "Do you wish to re-enter score number " << nscores << " (y | n) : ";
cin >> ans;
if (ans == y)
return 1;
if (ans == n)
{
return 0;
}
}
nscores = nscores + 1;
}
}
This is the part that is giving me issues. I have the right variables set and all. If you need a more in-depth look as to what this is doing, please use this link:
http://www.cs.uwm.edu/~cs201/semester/assignment/06/06/06.html
The program is #12.
2006-10-27
04:45:46
·
5 answers
·
asked by
Charlie
1
in
Computers & Internet
➔ Programming & Design