Write a main function, and the following functions

Assignment Help Basic Computer Science
Reference no: EM13166224

Write a main function, and the following functions to compute the stress and strain oa a steel rod(D) (in inches) and length(L) in inches subject to the compression load(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^6.
function to compute the stress formula:
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 different loads of P.

I have everything working right except the elongated or shortened length isn't taken into account.

#include <stdio.h>
#include <math.h>
#include<conio.h>

// computes stress of a steel rod takes load & diameter as parameters

double stress(long load, double d)

{

double A;

A= (3.14*d*d) /4.0;

return

load/A;

}

//computed strain of a steel road takes load & diameter as parameters

double   strain(long load,double d)

{

double f;

//calls stress funtion

f=stress(load,d);

//calculates f/E and returns as strain where E=30*10^6.

return

f/(30*pow(10.0,6));

}

//displays calculated stress & strain at each load.

void    output(long p,double stra,double stre)

{

printf("%6ld\t%0.4lf\t%.3lf\n",p,stra,stre);

}

int main()

{

double   d,strin,stres;  

//diameter,strain,stress

long   p;  

//load

//gets diameter of steel rod from user

printf("Enter diameter D of steel rod: ");

scanf("%lf",&d);

//computes stress and strain of steel rod at each load through 10000 to 1000000 increments of 100000

printf("\nLoad\tstrain\tstress\n\n");

for

(p=10000;p<=1000000;p=p+100000)

{

strin=strain(p,d);

stres=stress(p,d);

output(p,strin,stres);

}

printf("\n");
getch();
}

Reference no: EM13166224

Questions Cloud

Calculate the de broglie wavelength of an neutron : Calculate the de Broglie wavelength of an neutron moving at 1% the speed of light. Calculate the velocity of a neutron with a wavelength of 75pm.
State treatment with chloroform : A solid Silver Group (Anion) unknowon that contains only sodium ion as a catio is acidified and divided into tow portions, to both of which 6 M HC2H3O2
Design competition : Explain why you think Gustave Eiffel’s design was the one chosen from over 700 submissions to a design competition.
State the ph values of water and blood : * State what the patient can include and avoid in her diet on a regular basis to avoid these symptoms in the future.
Write a main function, and the following functions : Write a main function, and the following functions to compute the stress and strain oa a steel rod(D) (in inches) and length(L) in inches subject to the compression load(P) of 10,000 to 1,000,000 pounds
State a colored compound or complex ion : A colored compound or complex ion provides a preliminary indication of the presence of which of the aluminum Group ions? Give the chemical formula
Describe a contemporary monument : Describe a contemporary monument in your city or in another U.S. city and whether it holds some special significance for the citizens of the city where it was erected. State whether you like or dislike the monument and explain why.
What is internal audits role in the organizations ethics : What is internal audits role in the organization's ethics and compliance program and what is the board's role in the organization's ethics and compliance program?
What will be the mass of the probe on the surface of mars : If a space probe weights 39,200 N on the surface of earth, what will be the mass of the probe on the surface of mars.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd