#include <iostream> // stream
#include <cmath> // math functions
#include <cctype> // toupper
using namespace std;
int main()
{
int jul1;
int jul2;
int diff;
int jdate;
int toupper;
char ans = 'Y';
do
{
jul1 = jdate(); /* Term does not evaluate to a function */
jul2 = jdate(); /* Term does not evaluate to a function */
diff = jul1-jul2;
cout << "# of days between the two dates: " << diff;
cout << "Again?(Y/N): ";
ans = toupper( cin.get() ); /* Term does not evaluate to a function */
} while ( ans == 'Y');
}
int jdate(int jul1, int jul2 )
{
int day,month,year,year1,leapyear,regyear;
int DayInMonth[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int DaysInYear[] = {0,0,31,59,90,120,151,181,212,243,273,304,334,365};
int DaysInLeapYear[] = {0,0,31,60,91,121,152,182,213,244,274,305,335,366};
do
{
cout << "Year: ";
cin >> year;
} while (year < 1900 || year > 2099);
do
{
cout << "Month: ";
cin >> month;
} while (month < 1 || month > 12);
do
{
cout << "Day: ";
cin >> day;
} while (day < 1 || day > 31);
DaysInLeapYear[month];
DaysInYear[month];
if ( year % 4 == 0 && year1 == 0)
jdate = year * 365 + (year-1)/4 + DaysInLeapYear[month] + day; /* '='overloaded function as left operand */
else
jdate = year * 365 + (year-1)/4 + DaysInYear[month] + day; /* '='overloaded function as left operand */
return 0;
}
I don't understand why i am getting the
"term does not evaluate to a function" error on the line:
jul1 = jdate();
and
jul2 = jdate();