Converting to Julian Date

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?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//*************************************************************************************************
//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;
}
I'm zooming into here on line 17:
1
2
3
4
5
(J - 2 -(J - 14)/ 12 *12) 2/ 12 - 3 * ((I + 4900 +(J-14)/12)/100)/4;
(J - 2 -(J - 14)/ 12 *12) 2/ 12
/ 12 *12) 2/ 12
*12) 2/
12) 2

You're missing an operator between the 12) and the 2.

It's thinking that you just forgot a ; but we know that isn't the case.

Aha! Thanks!
Topic archived. No new replies allowed.