Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please can you use if if else while And can you use C++ programing language Question: The pressure of a gas changes as the volume

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Please can you use if if else while And can you use C++ programing language Question: The pressure of a gas changes as the volume and temperature of the gas vary, Write a program that uses the Van der Waals equation of state for gas, VANDRET You need to display in tabular form the relationship between the pressure and the volume of n moles gas at a constant temperature (T), P is the pressure and V is the volume. Use 8.3145 for gas constant R. Your program will output a table that varies the volume of the gas from the initial to the final volume in steps prescribed by the volume increment. Your program should ask the user to continue or stop. To continue user must enter y", to stop a letter. If the user enters different letter from yor's the program should continue to ask again as in sample run. Assume that user can enter one letter Attention: **You have to solve the problem using what we have covered in the class so far. For example, you CAN NOT USE any standard library functions or operations such as strings in the solution which we did not teach you! **The output format must be the same format as the sample runs below! Here is some sample run Sample Run 1: Enter the name of gas: H * Here Usersary to enter some specification of the gas Quantity of H (moles): 1.2 Temperature (kelvin): 356 Initial volum (milliliters): 400 Final volume (milliliters): 600 Volume increment (milliliters): 50 1.200 moles of Hat 356 kelvin Here program starts the out the ves Volume (ml) Pressure (atm) 400 450 500 550 600 8.8799 7.8932 7.1039 6.4581 59199 * Here program asks the user to contorno The serenied to the program is ferminated with by Do you want to continue lynn Bye. Sample Run 2: Enter the name of gas: N Quantity of N (moles) 0.2 Temperature (kelvin): 300 Initial volume (milliliters): 245 Final volume (milliliters): 300 Volume increment (milliliters): 17 0.200 moles of Nat 300 kelvin Volume (ml) Presse (atm) 245 262 279 2.0362 1.9041 1.7881 1.6854 Here are any The programs ask where Do you want to continue lync You entered wrong character Do you want to continue lyn You entered wtong character Do you want to continue Lynn Bye Sample Run 3: Enter the name of gas: 0 Quantity of (molesk: 2.3 Temperature (kelvin): 100 Initial volume (milliliters): 200 Final volume (milliliters: 300 Volume increment (milliliters 50 2.300 moles of at 100 kelvin Volume (ml) Pressure (atm) 9.5617 250 7,6493 63744 the sy The program should ask the specification of the After some computing in displays its value in Do you want to continetyy Enter the name of gas F Quantity of F (molesk: 34 Temperature (kelvin): 245 Initial volume milliliters: 300 Final volume (milliliters): 500 Volume increment (milliliters) 15 3.400 moles of Fat 245 kelvin Volume (ml) Prosure (atm) 300 23.0866 315 21.9872 330 20.9878 345 20.0753 360 19.2388 375 18.4693 17.7589 405 17.1012 420 16.4904 435 15.9218 450 15.3911 465 14.8946 480 14.4291 495 13.9919 390 Do you want to contine (ynn Bye. Please do can not use cout and cin I did not learn it My teacher used factor we didnt know other method

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 Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago

Question

5. Describe the relationship between history and identity.

Answered: 1 week ago