I have been tasked with an assignment for "oddball questions". Basically it is a case-switch statement that should handle several different situations.

The assignment is very simple, and I will post the full assignment as an attachment. However, (from my TA):

Your program must have the following functions:

a getName function which will input the name of the Geek
an isEven function that takes two integers and returns a boolean value indicating if the sum of the numbers is even or not
a sum function that takes two integers and computes and returns an int which is the sum of all numbers between the two inclusive (include the numbers in the sum) – for full credit this method should work even if the two numbers are the same (the sum is just one of the numbers) or if the first number is larger than the second. Also, you cannot assume which number will be greater.
a isLeapYear function that takes an integer and returns a boolean value indicating if the number is a leap year. A leap year is one with 366 days. A year is a leap year if it is divisible by 4 (for example, 1980), and if it is not divisible by 100 (for example 1900); however, it is a leap year if it is divisible by 400 (for example, 2000).
a display function which will display the geeks name and the number of questions that have been asked so far. This question is not included in calculating the number of questions asked so far.
The four functions should have the following prototypes:

string getName(int & countQuestions);
boolean isEven(int firstNumber, int secondNumber, int & countQuestions);
integer isEven(int firstNumber, int secondNumber, int & countQuestions);
boolean isLeapYear(int year, int & countQuestions);
void display(string name, int countQuestions);
The program will ask a user to enter one of the following commands. Based on the user's choice, the program needs to perform corresponding operation. The program will terminate when the user enters 'q'.

Now, I don't think that the function prototypes are possible as they differ only from the type of return.
When following my assignment sheet, I receive many errors from visual C++ regarding the fact that the two prototypes differ only by the type of return.
Any insight would be greatly appreciated.

q.

2. [i didn't read the 2nd paragraph of ur post]

bool and ints are technically the same thing in C++
What's int isEven() supposed to return anyways?

3. Now, I don't think that the function prototypes are possible as they differ only from the type of return.
That is right. Check with your teacher as it is probably a mistake. I suspect that the version that returns a bool is the correct one, since by the name "isEven" I would expect the function to return true if the sum of the numbers is even. A non-zero value can also be interpreted as true, but in the context of C++ that would be unnecessary here.

bool and ints are technically the same thing in C++
Not quite the same, of course. Certainly not technically.

4. 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.

5. my bool isEven function is essentially the same thing, where true replaces 1, and false replaces 0.
Yes, I would expect that to be the case.

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:
You are correct. However, I note that your TA wrote: "The four functions should have the following prototypes", but then went on to provide five possible prototypes. boolean and integer are not native types (they should be bool and int instead), so I think that your TA was just giving possible examples. Ultimately, you have to pick four of them and use the correct return types.

6. Ok. That confirms what I thought. Other than that, my code works well (aside from the quit case and the default case which I haven't put in yet).
I've posted something along those lines on my class board.
Thanks much.

q.