Question

#include <iostream> #include<cmath> using namespace std; int main() { float R = 8.314; // ideal gas...

#include <iostream>
#include<cmath>
using namespace std;

int main()
{
float R = 8.314; // ideal gas constant in J/(mole-K)
float F = 81;
float C = (F-32)*5/9;
float T = C + 273;
cout << " 70 degree F = " << T << endl;
  
double P = 13600*(30*2.54/1000)*9.81; // P density*g*h
cout << " P : " << P << " Pascal " << '\n';
  
double V = 10*10*5; // volume in m^3
double k_B = 1.38E-23; // Boltzmann Constant
double N = P*V/(k_B*T);
cout << " # of gas molecules : " << N << "\n";
float n = N*k_B/R;
  
cout << " # of moles here : " << n << 'n';
  
float m = 28*1.6E-27; // N_2 is 28 atomic mass unit
float Nm = N*m;
  
cout << " Total mass of gas molecules : " << Nm << " kg " << '\n';
  
double v_rms = sqrt(3*k_B*T/m);
cout << " Average speed of N2 : " << v_rms << '\n'; // in m/s
  
float v_rms_MPH = (v_rms*3600/(2.54*1000));
cout << " in MPH v_rms : " << v_rms_MPH << '\n';

// Write a program to obtain v_rms at 100F

// Calculate v_rms for T = Highest Temp recorded in Manhattan in last 5 yers
// as for example could be 100 F

please us C++ TO PROGRAMING

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

Just modified from provided code

Code prompts user to enter Temperature in Fahrenheit then Calculate v_rms

If any modifications needed use comment section

#include <iostream>
#include<cmath>
using namespace std;

int main()
{
float R = 8.314; // ideal gas constant in J/(mole-K)
float F;
cout<<"Enter Temperature in Fahrenheit: ";
cin>>F;
float C = (F-32)*5/9;
float T = C + 273;
cout <<" "<< F<<" degree F = " << T << endl;

double P = 13600*(30*2.54/1000)*9.81; // P density*g*h
cout << " P : " << P << " Pascal " << '\n';

double V = 10*10*5; // volume in m^3
double k_B = 1.38E-23; // Boltzmann Constant
double N = P*V/(k_B*T);
cout << " # of gas molecules : " << N << "\n";
float n = N*k_B/R;

cout << " # of moles here : " << n << 'n';

float m = 28*1.6E-27; // N_2 is 28 atomic mass unit
float Nm = N*m;

cout << " Total mass of gas molecules : " << Nm << " kg " << '\n';

double v_rms = sqrt(3*k_B*T/m);
cout << " Average speed of N2 : " << v_rms << '\n'; // in m/s

float v_rms_MPH = (v_rms*3600/(2.54*1000));
cout << " in MPH v_rms : " << v_rms_MPH << '\n';
}

Add a comment
Know the answer?
Add Answer to:
#include <iostream> #include<cmath> using namespace std; int main() { float R = 8.314; // ideal gas...
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