Question: Can you help me with writing the code, part d? Name: Glzem Tute Student w 3455 43 Term/Section: 41302 Further suppose that we wish to
Name: Glzem Tute Student w 3455 43 Term/Section: 41302 Further suppose that we wish to print the plate's temperature at points on a grid spaced units apart in the z-direction and y units apart in the y direction,starting at the origin. The diagram above shows the case where 1-10 and Ay = 10, We assume that the temperature at a point (E,) is given by: T(z,-10 sin( )cos(2 ) where L is the width of the plate and H is its height Here's sarnple output in the case where -10 and ". 10. Note how the columns of numbers line up and that the temperature along the line y 60 (at the top of the plate) is printed out first. TUco,y=60 Enter grid spacing in x-direction : 10 Enter grid apacing in y-direction: 10 y 60: 0.00 5.88 9.51 9.51 5.88 0.00 -5.88 -9.51 -9.51 5.88 -0.00 . 50: 10:00 2.94 4.76 4.76 2.94 o.00-2.94-4.76-4.76-2.94-0.00 y 40: -0.00 -2.94 -4.76 -4.76 -2.94 0.00 2.94 4.76 4.76 2.94 0.00 y 30 -0.00-5.88 -9.51 -9.51 -5.88 0.00 5.88 9.51 9.51 5.88 0.00 y" 20: 1-0.00-2.94-4.76-4.76-2.94-0.00 2.94 4.76 4.76 2.94 o.00 y 10: 0.00 2.94 4.76 4.76 2.94 0.00 -2.94 -4.76 -4.76 -2.94-0.00 y 0: 0.00 5.88 9.5 9.1 5,88 0.00 -5.88 -9.51 -9.51 -5.88 -0.o (a) Propose a way of decormposing this problem into smaller sub-problems and draw K-to flowcharts to represent your solution. Assume that the user is prompted for Ar and , that these are integer values and that Ar and divide exactly into L and H, respectively Page 3 of 4 Control VII APSC 160 Name: Glzem Tute Student w 3455 43 Term/Section: 41302 Further suppose that we wish to print the plate's temperature at points on a grid spaced units apart in the z-direction and y units apart in the y direction,starting at the origin. The diagram above shows the case where 1-10 and Ay = 10, We assume that the temperature at a point (E,) is given by: T(z,-10 sin( )cos(2 ) where L is the width of the plate and H is its height Here's sarnple output in the case where -10 and ". 10. Note how the columns of numbers line up and that the temperature along the line y 60 (at the top of the plate) is printed out first. TUco,y=60 Enter grid spacing in x-direction : 10 Enter grid apacing in y-direction: 10 y 60: 0.00 5.88 9.51 9.51 5.88 0.00 -5.88 -9.51 -9.51 5.88 -0.00 . 50: 10:00 2.94 4.76 4.76 2.94 o.00-2.94-4.76-4.76-2.94-0.00 y 40: -0.00 -2.94 -4.76 -4.76 -2.94 0.00 2.94 4.76 4.76 2.94 0.00 y 30 -0.00-5.88 -9.51 -9.51 -5.88 0.00 5.88 9.51 9.51 5.88 0.00 y" 20: 1-0.00-2.94-4.76-4.76-2.94-0.00 2.94 4.76 4.76 2.94 o.00 y 10: 0.00 2.94 4.76 4.76 2.94 0.00 -2.94 -4.76 -4.76 -2.94-0.00 y 0: 0.00 5.88 9.5 9.1 5,88 0.00 -5.88 -9.51 -9.51 -5.88 -0.o (a) Propose a way of decormposing this problem into smaller sub-problems and draw K-to flowcharts to represent your solution. Assume that the user is prompted for Ar and , that these are integer values and that Ar and divide exactly into L and H, respectively Page 3 of 4 Control VII APSC 160
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
