Answer
#include
#include
int main(void)
{
$\ \ \ \ $const double pi=3.14159;
$\ \ \ \ $double Tmean, Tpeak, omega=2*pi/365, T, sum=0,tmean;
$\ \ \ \ $int tpeak=205, t, t1, t2;
$\ \ \ \ $printf("Tmean="); scanf("%lf",&Tmean);
$\ \ \ \ $printf("Tpeak="); scanf("%lf",&Tpeak);
$\ \ \ \ $printf("first day: "); scanf("%d",&t1);
$\ \ \ \ $printf("last day: "); scanf("%d",&t2);
$\ \ \ \ $for(t=t1;t<=t2;t++)
$\ \ \ \ ${
$\ \ \ \ $$\ \ \ \ $T=Tmean+(Tpeak-Tmean)*cos(omega*(t-tpeak));
$\ \ \ \ $$\ \ \ \ $sum+=T;
$\ \ \ \ $}
$\ \ \ \ $tmean=sum/(t2-t1+1);
$\ \ \ \ $printf("%g",tmean);
$\ \ \ \ $return 0;
}
-----
$Result$
(a)
$$T=16.2$$
(b)
$$T=22.3$$
also, see the following image:
Work Step by Step
--