Hi all!
OK, so here is my question (code is below): class name for the below project is Date. In the below functions that return a boolean and a string, what is (Date dt)? I'm used to seeing parameter syntax as (datatype dataname). What the heck is Date doing where the data type normally goes? Where did this "dt" come from? It kind of fell out of the sky, there is no earlier reference to it in the data declaration, and it is in the method declaration section as :
bool Date::isWeekday(Date dt);
string Date::NameOfDay(Date dt);
Would someone explain to me what this is and what is does in the program? I'm so lost and frustrated, and my professor thinks I'm a dummy, but the text does not explain at all!
-Patrick
__________________________________________________
Code:bool Date::isWeekday(Date dt) { int day; day = dt.dayOfWeek(); if(day >= 2 && day <= 6) return true; else return false; } string Date::nameOfDay(Date dt) { int day; day = dt.dayOfWeek(); switch(day) { case 0: return "Satruday"; break; case 1: return "Sunday"; break; case 2: return "Monday"; break; case 3: return "Tuesday"; break; case 4: return "Wednesday"; break; case 5: return "Thursday"; break; case 6: return "Friday"; break; } }