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 106 .
A function to compute the stress from the formulas:
stress f = P/A where A= πD2 /4.0
A function to compute the strain from the formulas:
elongated or shortened length ΔL =(fL)/E
strain e = (ΔL)/L = f/E
A function to output the stress and strain at differnt loads of P:
Main calls each function ( calculate stress, calculate strain, and Output)