{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Homework #2 - MAE 9 Homework#2 Fall 2008 Due on Monday...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 /* MAE 9: Homework #2, Fall 2008 Due on Monday, October 13, Turnin from 9:00am - 9:00pm Compute the area (A) and the volume (V) of a sphere with radius R=0.1, R=0.2, R=0.3, ... , R=1.5 . Compute also the total area (TA) and the total volume (TV) of all these spheres together. Finally, compute the average radius, average area, and average volume of considered spheres (R_av, A_av, V_av). Define PI by using #define and use a for-loop to repeat calculations for different values of R. (Use PI=3.141593 and recall the elementary formulas A=4*PI*R*R and V=4*PI*R*R*R/3 or V=A*R/3). For each sphere, print in one line Sphere (k) Radius = "number" Area = "number" Volume = "number" At the end, in a separate line, print Total Area = "number" Total Volume = "number" In a separate line print also: Average Radius = "number" Average Area = "number" Average Volume = "number" Use the output specifier 2d for k (k is a sequential number of the sphere), 4.1f for R, and 7.3f for A, V, TA, TV, R_av, A_av, V_av. Hint: Consult forloop.c in week2.c subdirectory in lecture directory ..........................................................................
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern