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, to create a file that displays in tabular form the relationship between the pressure and the volume of n moles of carbon dioxide at a constant absolute temperature (T). P is the pressure in atmospheres, and V is the volume in liters. The Van der Waals constants for carbon dioxide are a = 3.592 L2 · atm/mol2 and b = 0.0427 L/mol. Use 0.08206 L · atm/mol · K for the gas constant R. Inputs to the program include n, the Kelvin temperature, the initial and final volumes in milliliters, and the volume increment between lines of the table. 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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
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,

to create a file that displays in tabular form the relationship between the pressure and the volume of n moles
of carbon dioxide at a constant absolute temperature (T). P is the pressure in atmospheres, and V is the
volume in liters. The Van der Waals constants for carbon dioxide are a = 3.592 L2 · atm/mol2 and b = 0.0427
L/mol. Use 0.08206 L · atm/mol · K for the gas constant R. Inputs to the program include n, the Kelvin
temperature, the initial and final volumes in milliliters, and the volume increment between lines of the table.
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. Here is a sample run:

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,
an2
(V – bn)
V2
= nRT
-
to create a file that displays in tabular form the relationship between the pressure and the volume of n moles
of carbon dioxide at a constant absolute temperature (T). P is the pressure in atmospheres, and V is the
volume in liters. The Van der Waals constants for carbon dioxide are a = 3.592 L²· atm/mol? and b = 0.0427
L/mol. Use 0.08206 L· atm/mol · K for the gas constant R. Inputs to the program include n, the Kelvin
temperature, the initial and final volumes in milliliters, and the volume increment between lines of the table.
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. Here is a sample run:
%3D
Please enter at the prompts the number of moles of carbon
dioxide, the absolute temperature, the initial volume in
milliliters, the final volume, and the increment volume
between lines of the table.
Quantity of carbon dioxide (moles)> 0.0
Temperature (kelvin)> 300
Initial volume (milliliters)> 400
Final volume (milliliters)> 600
Volume increment (milliliters)> 50
OUTPUT:
0.0200 moles of carbon dioxide at 300 kelvin
Volume (ml)
Pressure (atm)
400
1.2246
450
1.0891
500
0.9807
550
0.8918
600
0.8178
Transcribed Image Text: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, an2 (V – bn) V2 = nRT - to create a file that displays in tabular form the relationship between the pressure and the volume of n moles of carbon dioxide at a constant absolute temperature (T). P is the pressure in atmospheres, and V is the volume in liters. The Van der Waals constants for carbon dioxide are a = 3.592 L²· atm/mol? and b = 0.0427 L/mol. Use 0.08206 L· atm/mol · K for the gas constant R. Inputs to the program include n, the Kelvin temperature, the initial and final volumes in milliliters, and the volume increment between lines of the table. 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. Here is a sample run: %3D Please enter at the prompts the number of moles of carbon dioxide, the absolute temperature, the initial volume in milliliters, the final volume, and the increment volume between lines of the table. Quantity of carbon dioxide (moles)> 0.0 Temperature (kelvin)> 300 Initial volume (milliliters)> 400 Final volume (milliliters)> 600 Volume increment (milliliters)> 50 OUTPUT: 0.0200 moles of carbon dioxide at 300 kelvin Volume (ml) Pressure (atm) 400 1.2246 450 1.0891 500 0.9807 550 0.8918 600 0.8178
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY