The pressure of a gas changes as the volume and temperature of the gas vary. Write a
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:
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
- Python programming language Write a program that asks the user for a number. Write the number to a file called total.txt. Then ask the user for a second number. Write the new number on line 2 with the total for both numbers next to it separated by a comma. Then ask the user for a third number and do the same. Keep asking for numbers until the person puts in a zero to terminate the program. Close the file. Be sure to use at least 2 functions [main() and total_numbers(number, total)]. Put all inputs and outputs into the main function, with all calculations into the total_numbers function. Give me a number: 13 Give me another number: 14 14 + 13 = 27 Give me another number: 3 3 + 27 = 30 Give me another number: 4 4 + 30 = 34 Give me another number (0 for quit): 0 Your total is 34. Write a program that displays the lines from the total.txt file in the following output. Use a try catch phrase to check for errors. Use only one function for this portion [main()]. 13 14, 27 3,…arrow_forwardThe objective of this problem is to show that you can write a program that reads a text file and uses string methods to manipulate the text. File cart.txt contains shopping cart type data from golfsmith.com representing the gifts you have purchased for your dad for this past Fathers Day. Good for you. You have been very generous! The first item in each row of the file is the part number, the second the quantity, the third the price and the fourth the description. Your program will read the file line by line and compute the total cost of all of the items in the list. You will then display a message that looks like this, assuming the cost of each item adds up to 168.42: Here's what your output should look like: The total price for the awesome Fathers Day gifts you bought is $168.42. The shopping cart can be found here: cart.txt. Right click on the link and save the file to the folder where you have your Python files.arrow_forwardThis is for Python version 3.8.5 and please include pseudocode. A file named gang.txt is shown below. Write Python code that opens this file, reads only the first two lines, and prints “Penny is 19” gang.txt (contents of file) - please create on with the data provided in order to complete this question. Thank you! Penny 19 Kenny 20 Benny 21 Jenny 20arrow_forward
- 1. Read a list of fictional characters from a file named "Characters.txt" and store them in a Python list of dictionaries. Characters.txt: "Harry Potter", "Harry Potter series", "J.K. Rowling" "Frodo Baggins", "The Lord of the Rings series", "J.R.R. Tolkien" "Sherlock Holmes", "Sherlock Holmes series", "Arthur Conan Doyle" "Lara Croft", "Tomb Raider series", "Core Design" "James Bond", "James Bond series", "lan Fleming" "Katniss Everdeen", "The Hunger Games series", "Suzanne Collins" 1. Output all the fictional characters in your list. 2. Output all characters created by J.K. Rowling. 3. Output all characters from book series. 4. Count how many characters are from the "Harry Potter" series. 5. Create a histogram of the authors. Each element in the histogram should represent the count of characters created by a specific author. 6. Take all the characters in "Characters.txt" and store them in a Python set of tuples where each tuple represents (character name, book/series, author). 7.…arrow_forwardPython Create a program that reads the file (create a paragraph in a file). It should analyze each character of the file. For output, it should produce a well-formatted table indicating: The total number of printable characters The total number of capital letters The total number of lowercase letters The total number of numbers The total number of sentences (which end in a period) The total number of paragraphs (which end in a newline) Since the lab is an exercise in strings, you must use at least TWO different string methods to required information. And each stastic will need its own function.arrow_forwardFor this assignment, you will write a Python program that uses a file named scores.txt to store sets of bowling scores for different dates. scores.txt should store the data so that each line has a month, day, and the scores the user earned on that date. As an example, scores.txt might look something like this: January 15 200 300 126 200 250April 20 125 100 May 17 300 100 215 The very first time your program starts, scores.txt should not exist (i.e. create it with Python code the first time the program runs). In your main function, continuously give the user the following five options: Quit the program. View all Scores. If the user selects this option, call a function named view_scores. This function should print the scores in a nicely formatted manner. For example: "On January 15, you scored 200, 300, and 126", etc.. Add a Score. If the user selects this option, call a function named add_score. This function should ask the user for a month, day, and as many scores as they want to…arrow_forward
- Please help with this python problem, I am confuse don how to go about it.arrow_forwardThis list attached below is a chronological list of the World Series winning teams from 1903 through 2009. (The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2009. Note the World Series was not played in 1904 or 1994.) Write a python program that lets the user enter the name of a team, then displays the number of times that team has won the World Series in the time period from 1903 through 2009. Boston Americans New York Giants Chicago White Sox Chicago Cubs Chicago Cubs Pittsburgh Pirates Philadelphia Athletics Philadelphia Athletics Boston Red Sox Philadelphia Athletics Boston Braves Boston Red Sox Boston Red Sox Chicago White Sox Boston Red Sox Cincinnati Reds Cleveland Indians New York Giants New York Giants New York Yankees Washington Senators Pittsburgh Pirates St. Louis Cardinals New York Yankees New York Yankees Philadelphia Athletics Philadelphia Athletics St. Louis Cardinals New York Yankees New York…arrow_forwardJava Your program must read a file called personin.txt. Each line of the file will be a person's name, the time they arrived at the professor's office, and the amount of time they want to meet with the professor. These entries will be sorted by the time the person arrived. Your program must then print out a schedule for the day, printing each person's arrival, and printing when each person goes in to meet with the professor. You need to print the events in order of the time they happen. In other words, your output will be sorted by the arrival times and the times the person goes into the professor's office. In your output you need to print out a schedule. In the schedule, new students go to the end of the line. Whenever the professor is free, the professor will either meet with the first person in line, or meet with the first person in line if nobody is waiting. Assume no two people arrive at the same time. You should solve this problem using a stack and a queue. You can only…arrow_forward
- Hi, I need to solve this problem with C++ programming language using Visual Studio. Thank you.arrow_forwardAssume that name and age have been declared suitably for storing names (like "Abdullah", "Alexandra" and "Zoe") and ages respectively. Write some code that reads in a name and an age and then prints the message "The age of NAME is AGE." where NAME and AGE are replaced by the values read in for the variables name and age. For example, if your code read in "Rohit" and 70 then it would print out "The age of Rohit is 70.".arrow_forwardIn Python, Use number.txt file (below). create a program that opens num.txt, a file consisting of a series of integers. Display all of the numbers in the file. num.txt 10 25 36 45 89 42 54 please write code as simply as you can. Please have good variables.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY