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

Write a C++ program according to the following specifications 1. Display a brief

ID: 3683644 • Letter: W

Question

Write a C++ program according to the following specifications

1. Display a brief description of the program.

2. Ask the user to specify the type of loading (end load, intermediate load, uniform load)

3. Ask the user to specify the type of material (give the user of menu of 7 material types listed above) and then use the given value of E.

4. Ask the user for the beam dimensions (L, B, b, H, and h). Use a function to find the moment of inertia. (where: the lowercase ‘b’ is the flange width parameter for calculating I, moment of inertia).

5. If an end load or intermediate load is chosen, prompt the user to enter the weight of the load.

6. If a uniform load is selected, prompt the user to enter the weight density.

7. If an intermediate load is chosen, prompt the user to enter the value of ‘a’ (the location of the load).

8. Create 3 functions to calculate for the three types of loading.

9. Prompt the user to specify the number of points, N (in addition to x = 0) to use in a table of x and values.

10. Clear the screen and display the following:

A brief description of the program.

The type of loading and type of material.

All input quantities (both variable and name) with units. Also display I.

Display a table of values of x and with an appropriate table heading (with units) and with all values nicely aligned. Other important notes: User prompts should include both symbol and name of variable and unit.

Use scientific notation with 4 significant digits for most results.

Check all inputs for errors. If any inputs are entered incorrectly, allow the user to correct them. Error checks include: o Incorrect menu choices o All beam dimensions, weights, and weight density must be positive o H > h, B > b, L > a, and a > 0

Give the user the option of re-running the program.

INFORMATION:

The analysis of beams is an important topic in mechanical engineering. One type of beam considered is a cantilever beam in which one end of the beam is fixed and the other end of the beam is free.

When a weight, W, (or load) is applied the free end of the beam, the beam deflects or bends. The amount of deflection, , on the free end of the beam depends on the beams loading conditions. There are many types of loading conditions, but three types are considered here: 1) End load - A single load, W, is applied at the free end of the beam 2) Intermediate Load – A single load, W, is applied at point B (somewhere between the free end and the fixed end) 3) Uniform Load – The load W is uniformly distributed along the length of the beam.

W = total weight of load (N)

= deflection caused by the load (m),

x = distance from the free end of the beam (m),

L = length of the beam (m),

w = load density (N/m).

For a uniform load, W = w*L [(N/m)(m) = N]

The deflection for each beam can be calculated using the following relationships, assuming that the forces on the beam are coplanar, the beam is in static equilibrium, and that the weight of the beam may be neglected:

1) End Load: =(-W/6*E*I)*(x^3 -3*L^2*x+2*L^3)

( 2) Intermediate Load: for 0<=x<=b =(-W/6*E*I)(-a^3+3*a^2*L-3*a^2*x) OR for b<=x<=L =(-W/6*E*I)*((x-b)^3-3*a^2*(x-b)+2*a^3)  

3) Uniform Load: =(-W/6*E*I)(x^4-4*L^3*x+3*L^4)

where:

E = Young’s modulus of elasticity (N/m2 ),

I = moment of inertia (m4 ),

L = length of beam (m, meters).

For the Intermediate Load, the following terms also apply:

a = distance from FIXED end of beam to application of the load (m, meters),

b = L – a.

For the Uniform Load: Weight = (Weight Density)(Beam Length) or W = (w)(L).

Young’s modulus of elasticity varies with different types of materials. The following are typical values:

Material and Young’s modulus (N/m2 ):

Aluminum 6.90 x 1010

Brass 11.7 x 1010

Carbon Steel 20.5 x 1010

Cast Iron 10.0 x 1010

Oak 1.10 x 1010

Stainless Steel 19.0 x 1010

Titanium 11.4 x 1010.

It will be assumed that the beam under consideration is an I-beam with the following dimensions:

H =outer height of I - Beam (m), h= inner height of I - Beam (m), B = outer width of I - Beam (m), b = width of both flanges of I - Beam (m)

The moment of inertia, I,for theI-Beam can be calculated as follows: I=(B*H^3 - 2*b*h^3)/12 (m^4)

Explanation / Answer

#include<stdio.h>


int main()
{
double E=10e9;
double I=1.042e-6;
double L=9;
double a=3;
double W=70*9.81;
for(int x=0;x<=L;x++)
printf(" deflection(x=%d)=%lf",x,
Engineering::Structures::deflection_pp(L, a, W, x, E*I));
return 0;
}

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