from my code:
Code:
int isEven(int iEven1, int iEven2, int& questionCount)
{
int evenSum;
cout << "Please enter two integers, separated by a space: ";
cin >> iEven1 >> iEven2;
evenSum = iEven1 + iEven2;
questionCount++;
if (evenSum % 2 == 0)
return 1;
else
return 0;
}
my bool isEven function is essentially the same thing, where true replaces 1, and false replaces 0.
Code:
bool isEven(int bEven1, int bEven2, int& questionCount)
{
int evenSum;
cout << "Please enter two integers, separated by a space: ";
cin >> bEven1 >> bEven2;
evenSum = bEven1 + bEven2;
questionCount++;
if (evenSum % 2 == 0)
return true;
else
return false;
}
Basically, I'm not too worried about the code, as I have ~85% working already and the rest is just me running into this issue. What I'm looking for is the coexistance of bool functions and int functions where the arguments are the same.
I know that this should not work; I'd have to change one to only accept a single integer or maybe a double or something of those lines, however this is what has handed to me by my TA.
My mind says this shouldn't work BECAUSE the function prototypes HAVE to be as shown:
Code:
string getName(int & questionCount);
bool isEven(int bEven1, int bEven2, int & questionCount);
int isEven(int iEven1, int iEven2, int & questionCount);
int sum(int sum1, int sum2, int & questionCount);
bool isLeapYear(int yearLeap, int & questionCount);
void display(string geekName, int & questionCount);
and because they are the same, the main function can't differentiate between the two.
Let me know if this can/cannot be done. See the full code and assignment (in a poorly formatted text file, as it was originally given as an HTML file) in my previous post.
q.