Question

Write a program using a collection of functions to solve simple conduction problems using various forms...

Write a program using a collection of functions to solve simple conduction problems using various forms of the formula H = k * A * (T2-T1)/X H = k * A * (T2-T1)/X Temperature on the other side is 274 K. H = 755.0 W T2 = 298 K k = 0.800 W/m-k T1 = 274 K A = 0.120 m^2 X=0.003 m where H is the rate of heat transfer in watts, k is the coefficient of thermal conductivity for the particular substance in watts per meter Kelvin, A is the cross-sectional area in square meters, T1 and T2 are the Kelvin temperatures on the two sides of the conductor, and X is the thickness of the conductor in meters. Define a function for each variable in the formula. For example, function calcH would compute the rate of heat transfer, calcK would figure the coefficient of thermal conductivity, calcA would find the cross-sectional area, and so on. OUTPUT EXAMPLE Respond to the prompts with the data known. For the unknown quantity, enter -999. Rate of heat transfer (watts) : 755.0 Coefficient of thermal conductivity (W/m-K: 0.8 Cross-sectional area of conductor (m^2) : 0.12 Temperature on one side (K) : 298 Temperature on other side (K) : -999 (unknown) Thickness of conductor (m): 0.003

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

ANSWER:--

GIVEN THAT:--

  • #include<iostream>

    using namespace std;

    //funtion Prototypes

    void calH();

    void calK();

    void calA();

    //main method

    int main()

    {

    //integer variable

    int ch;

    do{

    //menu display

    cout<<"\n\tMENU\n";

    cout<<"1.calH\n";

    cout<<"2.calK\n";

    cout<<"3.calA\n";

    cin>>ch;

    switch(ch)

    {

    case 1:calH();break;

    case 2 :calK();break;

    case 3:calA();break;

    default:cout<<"Invalid Input\n";

    }

    }while(ch<1 ||ch>3);

    system("pause");

    return 0;

    }

    //calA funtiion definition

    void calA()

    {

    float K,A,H;

    int T1,T2;

    float X;

    cout<<"Rate of Heat Transfer(watts)\t";

    cin>>H;

    cout<<"Co-Effiecient of Thermal Conductivity(W/m-k)\t";

    cin>>K;

    cout<<"\nTemperature on one side (T1)\t";

    cin>>T1;

    cout<<"\nTemperature on one side (T2)\t";

    cin>>T2;

    cout<<"\nThick ness of conductor(m)\t";

    cin>>X;

    if(H==-999) K=0;

    if(K==-999) A=0;

    if(T1==-999) T1=0;

    if(T2==-999) T2=0;

    if(X==-999) X=0;

    A=H/(K*(T2-T1)*X);

    cout<<"\nCross-Sectional Area(m^2)\t"<<A;

    }

    //calK funtiion definition

    void calK()

    {

    float K,A,H;

    int T1,T2;

    float X;

    cout<<"Rate of Heat Transfer(watts)\t";

    cin>>H;

    cout<<"\nCross-Sectional Area(m^2)\t";

    cin>>A;

    cout<<"\nTemperature on one side (T1)\t";

    cin>>T1;

    cout<<"\nTemperature on one side (T2)\t";

    cin>>T2;

    cout<<"\nThick ness of conductor(m)\t";

    cin>>X;

    if(H==-999) K=0;

    if(A==-999) A=0;

    if(T1==-999) T1=0;

    if(T2==-999) T2=0;

    K=H/(A*(T2-T1)*X);

    cout<<"Co-Effiecient of Thermal Conductivity(W/m-k)\t"<<K;

    }

    //calH funtiion definition

    void calH()

    {

    float K,A,H;

    int T1,T2;

    float X;

    cout<<"Co-Effiecient of Thermal Conductivity(W/m-k)\t";

    cin>>K;

    cout<<"\nCross-Sectional Area(m^2)\t";

    cin>>A;

    cout<<"\nTemperature on one side (T1)\t";

    cin>>T1;

    cout<<"\nTemperature on one side (T2)\t";

    cin>>T2;

    cout<<"\nThick ness of conductor(m)\t";

    cin>>X;

    if(K==-999) K=0;

    if(A==-999) A=0;

    if(T1==-999) T1=0;

    if(T2==-999) T2=0;

    H=K*A*(T2-T1)*X;

    cout<<"Rate of Heat Transfer(watts)\t"<<H;

    }

    output:

Add a comment
Know the answer?
Add Answer to:
Write a program using a collection of functions to solve simple conduction problems using various forms...
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
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
ADVERTISEMENT