Hey guys,
I'm trying to take a date and convert it to a Julian number so that I can construct a schedule. Our teacher gave us example code to do this conversion, but I keep getting an error that I can't seem to fix...
|line 17 error: expected ';' before numeric constant|
I've been researching it online, and I don't understand many of the answers given. Can someone explain what I need to do in terms a newbie can understand?
//*************************************************************************************************
//Function to take date of installation and convert it to a julian date in order to calculate
//service schedule.
int ConvertDate(int year, int month, int day)
{//Passes in Installation date
//Declare variables to be used in converting date
int julianDate;
int I;
int J;
int K;
I = year;
J = month;
K = day;
//Formula to convert gregorian date to julian date
julianDate = K - 32075 + 1461 *(I + 4800 +(J - 14)/ 12)/ 4 + 367 *
(J - 2 -(J - 14)/ 12 *12) 2/ 12 - 3 * ((I + 4900 +(J-14)/12)/100)/4;
return julianDate;
}