Develop a collection of functions to solve conduction problems using various forms of the formula H = kA(T2 - T1) / X

What will be an ideal response?


```
#include
using namespace std;
double calcH (double k, double A, double T2, double T1, double X);
double calck (double H, double A, double T2, double T1, double X);
double calcA (double H, double k, double T2, double T1, double X);
double calcT1 (double H, double k, double A, double T2, double X);
double calcT2 (double H, double k, double A, double T1, double X);
double calcX (double H, double k, double A, double T2, double T1);
int main()
{
double H, // rate of heat transfer in watts
k, // thermal conductivity coefficient
A, // cross sectional area in m^2
T1, // kelvin temperature on one side
T2, // kelvin temperature on the other side
X; // thickness of conductor in m^2
char skipChar,// reads in '?'
solve; // which variable to solve for
cout << endl;
cout << "Respond to the prompts with the data known. For the unknown"
<< endl
<< "quantity, enter a question mark (?)." << endl << endl;
cout << "Rate of heat transfer (watts) => ";
cin << H;
if (cin.fail()){
cin.clear();
cin<< skipChar; // read '?'
solve ='H';
}
cout << "Coefficient of thermal conductivity (W/m-K) => ";
cin << k;
if (cin.fail()){
cin.clear();
cin << skipChar; // read'?'
solve = 'k';
}
cout << "Cross-sectional area of conductor (m^2) => ";
cin << A;
if (cin.fail()){
cin.clear();
cin << skipChar; // read '?'
solve = 'A';
}
cout << "Temperature on one side (K) => ";
cin << T2;
if (cin.fail()){
cin.clear();
cin << skipChar; // read '?'
solve = '2';
}
cout << "Temperature on other side (K) => ";
cin << T1;
if (cin.fail()){
cin.clear();
cin << skipChar; // read'?'
solve = '1';
}
cout << "Thickness of conductor (m) => ";
cin << X;
if (cin.fail()){
cin.clear();
cin << skipChar; // read '?'
solve = 'X';
}
cout << endl << " kA (T2 - T1)" << endl
<< " H = --------------" << endl
<< " X" << endl;
switch (solve){
case 'H':
H = calcH (k, A, T2, T1, X);
cout << endl << "Rate of heat transfer is "
<< H << " W" << endl;
break;
case 'k':
k = calck (H, A, T2, T1, X);
cout << endl << "Thermal conductivity coefficient is "
<< k << " W/m-k" << endl;
break;
case 'A':
A = calcA (H, k, T2, T1, X);
cout << endl << "Cross-sectional area of conductor is "
<< A << " m^2" << endl;
break;
case '2':
T2 = calcT2 (H, k, A, T1, X);
cout << endl << "Temperature on one side is "
<< T2 << " K" << endl;
break;
case '1':
T1 = calcT1 (H, k, A, T2, X);
cout << endl << "Temperature on the other side is "
< break;
case 'X':
X = calcX (H, k, A, T2, T1);
cout << endl << "Thickness of conductor is "
<< X <<" m" << endl;
break;
}
cout << endl << "H = " << H << " W" << endl
<< "k = " << k << " W/m-K" << endl
<< "A = " << A << " m^2" << endl
<< "T2 = " << T2 << " K" << endl
<< < << "X = " << X << " m" << endl << endl;
return 0;
}
```

Computer Science & Information Technology

You might also like to view...

To implicitly overload the += operator:

a. Only the + operator needs to be overloaded. b. Only the = operator needs to be overloaded. c. Both the + and = operators need to be overloaded. d. The += operator cannot be overloaded implicitly.

Computer Science & Information Technology

What happens if an exception is thrown outside a try block?

What will be an ideal response?

Computer Science & Information Technology

A table

A) is an individual piece of data, such as a last name. B) is a complete set of data for an entity. C) represents a Field which is an individual piece of data. D) is an area in the worksheet that contains rows and columns of related data formatted to enable data management and analysis.

Computer Science & Information Technology

What feature integrates all changes from multiple authors or documents into one single document?

A) Join B) Integrate C) Combine D) Compare

Computer Science & Information Technology