Andy C. answered 11/06/17
Tutor
4.9
(27)
Math/Physics Tutor
f(x) = { 1500 if 152 <= x <= 258,
1200 otherwise
}
where x is the Julian Date.
That is x=1 is Jan 1, X=2 is Jan 2, X=3 is Jan3, etc etc etc , 364 = Dec 30, 365 = Dec31
THe only problem with this is that the directions limit the function to one variable, and if it is
a leap year, then this function will not work. You need a second variable to detect whether
or not the year is a leap year.
A better way to do it with two variables is like this:
f ( M, D) = { 1500 if (6 <= M <=8) OR ((M=9) AND ( 1 <=D < =15)),
1200 otherwise
}
where M is the month and D is the day