1 Singledimension Array Compute the stress and strain in ste

1. (Single-dimension Array) Compute the stress and strain in steel columns subject to compression loads varying from 10,000 lbs to 100,000 lbs in increments of 5,000 lbs.a. The stress is given by the formula: b. The strain is given by: Where is the stress in lb/in2 or psi is the strain which is nondimensional, is the load in pounds, is the diameter in inches, and is the modulus of elasticity in psi, for steel this value is 30x106 psi The diameter of the column must be entered by the user. Your program must store the load, stress, and strain in separate one-dimensional arrays. Your program must display in table format the values for the load, stress and strain.

Solution

#include <stdio.h>
#define pi 3.14
#define elasticity 3*(10^6)
int main(void) {
   float strain,stress,load,diameter;
   float loadArray[19],strainArray[19],stressArray[19];
   int i;
   load = 10000;
   printf(\"please enter diameter \");
   scanf(\"%f\",&diameter);
  
   for(i=0;i<19;i++){
   stress = (4*load)/(pi*diameter*diameter);
   strain = stress/elasticity;
   stressArray[i] = stress;
   strainArray[i] = strain;
   loadArray[i] = load;
   load= load + 5000;
      
   }
   printf(\"load \\t stress \\t strain\");
   for(i=0;i<19;i++){
       printf(\"\ \");
       printf(\"%f %f %f\",loadArray[i],\"\\t\",stressArray[i],\"\\t\",strainArray[i]);
   }
   return 0;
}

1. (Single-dimension Array) Compute the stress and strain in steel columns subject to compression loads varying from 10,000 lbs to 100,000 lbs in increments of

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site