Write a main function and the following functions to compute the stress and strain in a steel rod of diameter D (inches) and length L (inches) subject to the compression loads p of 10,000 to 1,000,000 pounds in increments of 100,000 pounds. The modulus of elasticity E for steel is 30 x 10 with an exponent of 6.
A function to compute the stress from the formulas
Stress f = P/A (p divided by a)
Where A = πD^2 /4.0
A function to compute the strain from the formulas
Elongated pr shortened length L= FL/E
Strain e= L/L = f/E
A function to output the stress and strain at different loads of P.
The solution gives a complete c++ program on calculating the stress and strain in a steel rod of diameter D (inches) and length L (inches) subject to the compression loads. Explainations are added after some important codes. A screenshot of output is also given.