The variation of vapor pressure p (in units of mm Hg) of benzene with temperatur
ID: 3794132 • Letter: T
Question
The variation of vapor pressure p (in units of mm Hg) of benzene with temperature in the range of 0 lessthanequalto T lessthanequalto 42 degree C can he modeled with the equation (Handbook of Chemistry and Physics. CRC Press) log_10p = b - 0.05223a/T where a = 34172 and b = 7.9622 are material constants and T is absolute temperature (K). Write a program in a script file that calculates the pressure for various temperatures. The program should create a vector of temperatures from T = 0 degree C to T = 42 degree C with increments of 2 degrees, and display a two-column table p and T, where the first column temperatures in degree C, and the second column the corresponding pressures in mm Hg.Explanation / Answer
Here is program!
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
void Name ()
{
//Program name
cout << endl;
cout<< " Pressure Calculator " <<endl;
}
int main ()
{
//declarations
const double a= 34172, b= 7.9622
double v, n, t, initialvalue, finalvalue, incr, Pressure; //Defined all used variable
char Sent; //Sent=n continue
//Sent=y done
// Display Name
Name ();
cout <<endl <<endl;
cout << " Please enter the temperature (kelvin): ";
cin >> t;
Pressure= b - 0.05223a/t
finalvalue = logPressure
cout << finalvalue <<endl;
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.