Question

Image for 1 .Write a e program using the following structure to hold the compression load, p, and the diameter, cl, of a

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h>

#include <stdlib.h>

#include <math.h>

#define E 30000000   //elasticity value of steel

#define PI 3.14

struct Strength

{

  float p;

  float d;

  float l;

  float stress;

  float strain;

};


int main()

{

  FILE *rptr;

  FILE *wptr;

  

  rptr=fopen("input.txt","r");

  wptr=fopen("output.txt","wb");

  

  float area;

  struct Strength steel;

  

  while(fscanf(rptr," %f %f %f ",&steel.p,&steel.d,&steel.l)==3)       //reading from file

  {

    area=PI*(steel.d * steel.d)/4;

    steel.stress= steel.p/area;       //as formulae described in problem

    steel.strain=steel.stress/E;

    

    fprintf(wptr,"%f %f %f %f",steel.p,steel.d,steel.stress,steel.strain); //writing into file

    fprintf(wptr,"\n");

    

  }

  

  return 0;

}


answered by: codegates
Add a comment
Know the answer?
Add Answer to:
1 .Write a e program using the following structure to hold the compression load, p, and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2. A helical compression spring is made from No. 8 steel wire and is to carry a 100 lb static load at a deflection of 1 inch. The outside coil diameter of the spring is 0.972 inches. The spring ends...

    2. A helical compression spring is made from No. 8 steel wire and is to carry a 100 lb static load at a deflection of 1 inch. The outside coil diameter of the spring is 0.972 inches. The spring ends are squared. Assume the torsional yield strength of the wire is 80000 psi, and the shear modulus is 11.4 Mpsi, determine (a) The static load corresponding to the yield strength. (b) The deflection that would be caused by the load...

  • please be very 100% sure before doing. thank you (1) (25 points) Load-elongation dataset were obtained...

    please be very 100% sure before doing. thank you (1) (25 points) Load-elongation dataset were obtained from a tensile test of high-strength steel as shown in the table. The test specimen had a diameter of 0.505 in. and a gage length of 2.00 in. The Poisson's ratio of high-strength steel is found to be 0.33 At fracture, the elongation between the gage marks was 0.12 in and the minimum diameter was 0.42 in 1) Plot the engineering stress-strain curve using...

  • plz anser q1 3 4 1. Predictions of elastic modulus, yield and ultimate loads (attach additional...

    plz anser q1 3 4 1. Predictions of elastic modulus, yield and ultimate loads (attach additional sheets not enough space): Given: - steel tube outer diameter: 165.1mm; wall thickness: 3.3mm; no gap between concrete and steel. - Young's modulus of steel (200 GPa). Young's modulus of concrete (30 GPa). - strengths of concrete (45 MPa) and steel (yield stress q=350 MPa, ultimate stress 0,450 MPa). Calculate/Predict (see questions 9 & 10, in "stress-strain_deformation_16Questions_solutions.pdf): -Young's Modulus E of the composite material...

  • 1. A tensile test was performed using a standard 0.505 in. diameter specimen (Do 0.505 in)...

    1. A tensile test was performed using a standard 0.505 in. diameter specimen (Do 0.505 in) of 4140 steel with 2 inch initial gage length (Lo 2.00 in), and the following were determined: . Elastic Modulus (E)-30 x 106 psi Yield Strength (To) = 60,000 psi Strain at maximum load = 0.15 .Breaking Load (Pbreak) 15,000 lbs Maximum Load (Pa) 20,000 lbs 0 % Elongation-25% . a. (3 points) Calculate the stress at the break point: b. (5 points) Calculate...

  • Numbers: 1-7 1. During a stress-strain test, the unit deformation at a stress of 5,000 psi...

    Numbers: 1-7 1. During a stress-strain test, the unit deformation at a stress of 5,000 psi was observed to be 0.000167 in./in. and at a stress of 20,000 psi it was 0.000667 in./in. If the proportional limit is 30,000 psi, what is the modulus of elasticity? What is the stress corresponding to a strain of 0.0002 in./in.? Would these results be valid if the proportional limit were 18,000 psi? Explain. 2. A steel wire 30 feet long, hanging vertically, supports...

  • 1. The following is a one-layer truss structure fabricated from aluminum tubing with outside diameter and...

    1. The following is a one-layer truss structure fabricated from aluminum tubing with outside diameter and wall thickness as 0.4 inch and 0.05 inch, respectively. The Young's modulus and Poisson's ratio for aluminum are E= 10 x 10°psi, v=0.33, respectively. The applied load P is 60 Ib. Please answer = 60° B Ra all Cled URb The internal force for member AC is: -30 lb 34.6 lb 30 lb -34.6 lb Question 2 1 points Save Answer 1. The following...

  • The rigid beam ACE is subjected to the load P and suspended at points A, C, and E

    The rigid beam ACE is subjected to the load P and suspended at points A, C, and E by three suspender bars AB, CD, and EF (see Figure 1). These three suspender bars are made of the same steel and have the same circular cross section with the same diameter of d=30 mm. The ultimate 2m stress of steel is σu=450 MPa and Young modulus is E=200 GPa. (a) Using a factor of safety FS=1.5, determine the All maximum allowable load...

  • Assignment 01 TOT Mechanical Properties of Materials 1. A tensile test specimen has a gage length...

    Assignment 01 TOT Mechanical Properties of Materials 1. A tensile test specimen has a gage length = 50 mm and its cross-sectional area = 100 mm. The specimen yields at 48,000 N, and the corresponding gage length - 50.23 mm. This is the 0.2 ent yield point. The maximum load of 87,000 N is reached at a gage length 64.2 mm. Determine (a) yield strength, (b) modulus of elasticity, and (c) tensile strength. (d) If fracture occurs at a gage...

  • Length of Aluminum cylinder 100mm load applied : 100N diameter : 10mm max force : 15.01KN modulus...

    length of Aluminum cylinder 100mm load applied : 100N diameter : 10mm max force : 15.01KN modulus ( Automatic young’s) : 8254.64MPa The compression tests to be performed are focused on exhibiting the following types of instabilities in compression: Toble 1: L/D Ratio and Type of instability LD Ratio Type of Instability Buckling Shearing Double Barreling Barreling 5 or larger 25 LD5 2 < LD <2.5 Less than 2 with friction Less than 2 without friction Note that the friction...

  • A 3 m rigid bar AB is supported with a vertical translational spring at A and a pin at B The bar is subjected to a linearly varying distributed load with maximum intensity g Calculate the ver...

    A 3 m rigid bar AB is supported with a vertical translational spring at A and a pin at B The bar is subjected to a linearly varying distributed load with maximum intensity g Calculate the vertical deformation of the spring if the spring constant is 700 kN/m. (ans: 21.43 mm) 2. A steel cable with a nominal diameter of 25 mm is used in a construction yard to lift a bridge section weighing 38 kN. The cable has an...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT