Cplusplus_HW1 - Calculate radius by using Diameter/2 De´ne...

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

View Full Document Right Arrow Icon
Elizabeth King & Amanda Montoya Introduction to Engineering 1 Prof. Fahad AlGheshyan March 15, 2016 C++ Homework 1 1. Problem analysis: The program will compute the surface area and volume of three different hemispheres using three different diameters the user will impute. The program will compute this using the following formulas: Volume : The volume of a hemisphere is: V=2/3(πr^3) Surface Area : external side ? = 2 ??^ 2 Base = ?? = ??^ 2 Total surface area is: ? = ? + ? = (2 ??^ 2) + ( ??^ 2) = 3 ??^ 2 Radius = Diameter/2 2. Input : - The constant π= arcos(-1) - Diameter: This will be given by an output statement where the user will be able to assign the value for this variable. - This variables will be floating type (double) 3. Output: - Surface area (float) - Volume (float) 4. Algorithm: Assign the constant π. Define three different variables for diameter and radius.
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.

Unformatted text preview: Calculate radius by using Diameter/2. De´ne the variable volume. Calculate the volume by using the formula V=2/3(πr^3). De´ne the variable Surface Area. Calculate it by using the formula ? = ? + ? = (2 ??^ 2) + ( ??^ 2) = 3 ??^ 2. Display results. Problems solved by hand: V= 2/3(π (5/2) ^3) = 32.7249 meters^3 SA= 3 ? (5/2) ^ 2 = 58.9049 meters^2 V= 2/3(π (2/2) ^3 = 2.0944 meters^3 SA= 3 ? (2/2) ^ 2= 9.4248 meters^2 V= 2/3(π (1/2) ^3) = 0.2180 meters^3 SA= 3 ? (1/2) ^ 2 = 2.3562 meters^2 V= 2/3(π (3.5/2) ^3 = 11.2246 meters^3 SA= 3 ? (3.5/2) ^ 2 = 28.8634 meters^2 V= 2/3(π (4.2/2) ^3 = 19.3962 meters^3 SA= 3 ? (4.2/2) ^ 2=41.5633 meters^2 V= 2/3(π (8.8/2) ^3 = 178.4090 meters^3 SA= 3 ? (8.8/2) ^ 2 =182.4637 meters^2...
View Full 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