I have some parameters in my functions that receive and pass around the same value. Should I name all the parameter variables the same?
Example:
// assume numMonth = 12
// assume numYear = 2000
int promptMonth(); // returns numMonth
int promptYear(); // returns numYear
int daysInMonth(int numMonth, int numYear); // numMonth and numYear will always
int daysInYear(int numYear); // be sent to these.
bool isLeapYear(int numYear); // daysInYear() and daysInMonth() call
// this function and send it numYear
// (which would be 2000 in this case).
Should all those parameters be named the same since the same value is passed to each of them?
By same, I assume you mean the function parameter name
numYear.Yes it is always good practice to name the variables in a meaningful way which indicates the meaning/purpose of the value being passed.
And those variables are part of different functions, hence there scope is limited to those functions only, So there is no problem of multiple definitions if you are thinking of that.