Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make sure to make ONE flowchart and ONE appendix for each algorithm. This is done in a c++ program. #include #include #include using namespace std;

Make sure to make ONE flowchart and ONE appendix for each algorithm. This is done in a c++ program.

#include

#include

#include

using namespace std;

int tc(int x);

double tk(int x);

double psat(int y);

double p(int x, double y);

double d(double x, double y);

int main() {

cout << "Height" << setw(10) << "Temp" << setw(18) << "Pressure" << setw(13) << "Density" << setw(10) << "Psat" << endl;

cout << "------" << setw(10) << "----" << setw(18) << "--------" << setw(13) << "-------" << setw(10) << "----" << endl;

cout.precision(2);

for (int h = 17; h <= 23; h++) {

int tca = tc(h);

double tka = tk(tca);

double pa = p(h, tka);

double da = d(tka, pa);

double pasta = psat(tca);

cout << h << setw(14) << fixed << tca << setw(16) << pa << setw(16) << scientific << da << setw(12) << pasta << endl;

}

}

int tc(int x) {

return 3 * (x - 15) - 131;

}

double tk(int x) {

return 273.15 + x;

}

double psat(int y) {

return 6.1 * pow(10, (7.5 * y) / (237.3 + y));

}

double p(int x, double y) {

return 101.33 * exp(((-34.58 * x) / y));

}

double d(double x, double y) {

return y / (281 * x);

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions