Numerical Methods for Engineers

Published by McGraw-Hill Science/Engineering/Math
ISBN 10: 0073401064
ISBN 13: 978-0-07340-106-5

Chapter 2 - Programming and Software - Problems - Page 48: 2.10

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

--
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.