Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

INTRODUCTION: You are an engineer working for a company containment buildings. T

ID: 3881565 • Letter: I

Question

INTRODUCTION: You are an engineer working for a company containment buildings. The walls of the building are made from reinforce concrete, four feet thick. The containment building must be a cylinder with a spherical cap roof as illustrated to the right. The inner radius of the cylinder is given as Ra and the inner radius of the spherical roof cap is given as Rcan- The height of the cylindrical portion is given as that designs nuclear reactor hena EXAM Write a C program that will allow the user to enter the radius of the cylinder Rthe radius of the spherical cap Rcap the wall thickness, and the inner volume of the building. The program will compute the cylinder height Hoi. the spherical cap height hcan, the inner surface area of the building, and the total volume of concrete needed for the building. The program must use C's power function for all variables that are raised to a power Hal Wall Thickness The equation for the inner volume of the cylinder is NOTE: Define as a symbolic constant in the preprocessor directive section. The equation for the inner volume of the spherical cap is cap 3 where and is computed by cap

Explanation / Answer

I have used the above formula given in the problem for the calculation.

How to Compile on Linux using gcc:

gcc main.c -lm

-lm to link the C math library

C code:

#include<stdio.h>
#include<math.h>

#define PY 3.14

int main() {
double Vin, Vcon;
double Rcy;
double Rcap;
double Wth;
double Q, Hcap;
double Vcap;
double Hcy;
double Sin;

printf(" Enter the Inner Volume of the building in Cubic feet :");
scanf("%lf",&Vin);
printf(" Enter the Inner radius of Cylinder in the feet : ");
scanf("%lf",&Rcy);
printf(" Enter the Inner radius of the Spherical Cap in the feet : ");
scanf("%lf", &Rcap);
printf(" Enter the wall thickness of the building : ");
scanf("%lf", &Wth);

printf(" Inner Volume of the building in Cubic feet : %lf", Vin);
printf(" Inner radius of Cylinder in the feet : %lf", Rcy);
printf(" Inner radius of the Spherical Cap in the feet : %lf", Rcap);
printf(" Wall thickness of the building : %lf", Wth);

Q = asin(Rcy/Rcap);
Hcap = Rcap*(1-Q);

Vcap = (1/3)* PY * Hcap * Hcap * (3*Rcap - Hcap);

Hcy = (Vin - Vcap)/ (PY * Rcy * Rcy);

Sin = 2 * PY * Rcy* Hcy + 2 * PY * Rcap * Hcap;

printf(" Height of the cylinder is : %lf", Hcy);
printf(" Height of the spherical Cap is : %lf", Hcap);
printf(" Inner surface area of the building : %lf", Sin);

//calculating the Volume of concrete.
Vcon = ((1/3)* PY * Hcap * Hcap * (3*(Rcap + Wth) - Hcap)) + (PY* (Rcy + Wth) * (Rcy + Wth) * Hcy) - Vin;
printf(" Total Volume of concrete needed : %lf", Vcon);

}

C Code:

#include<stdio.h>
#include<math.h>

#define PY 3.14

int main() {
double Vin, Vcon;
double Rcy;
double Rcap;
double Wth;
double Q, Hcap;
double Vcap;
double Hcy;
double Sin;

printf(" Enter the Inner Volume of the building in Cubic feet :");
scanf("%lf",&Vin);
printf(" Enter the Inner radius of Cylinder in the feet : ");
scanf("%lf",&Rcy);
printf(" Enter the Inner radius of the Spherical Cap in the feet : ");
scanf("%lf", &Rcap);
printf(" Enter the wall thickness of the building : ");
scanf("%lf", &Wth);

printf(" Inner Volume of the building in Cubic feet : %lf", Vin);
printf(" Inner radius of Cylinder in the feet : %lf", Rcy);
printf(" Inner radius of the Spherical Cap in the feet : %lf", Rcap);
printf(" Wall thickness of the building : %lf", Wth);

Q = asin(Rcy/Rcap);
Hcap = Rcap*(1-Q);

Vcap = (1/3)* PY * Hcap * Hcap * (3*Rcap - Hcap);

Hcy = (Vin - Vcap)/ (PY * Rcy * Rcy);

Sin = 2 * PY * Rcy* Hcy + 2 * PY * Rcap * Hcap;

printf(" Height of the cylinder is : %lf", Hcy);
printf(" Height of the spherical Cap is : %lf", Hcap);
printf(" Inner surface area of the building : %lf", Sin);

//calculating the Volume of concrete.
Vcon = ((1/3)* PY * Hcap * Hcap * (3*(Rcap + Wth) - Hcap)) + (PY* (Rcy + Wth) * (Rcy + Wth) * Hcy) - Vin;
printf(" Total Volume of concrete needed : %lf", Vcon);

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote