Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help with my python homework! i have to write a program for calculating t

ID: 3761242 • Letter: I

Question

I need help with my python homework! i have to write a program for calculating the volume of an amount of oxygen (o2) at a given temperature, assuming sea level pressure . anything is greatly appreciated!

Requirements

You will complete a program that calculates the volume of a gas (Oxygen (02) is assumed), using a formula known as the ideal gas law, given the following input:

Input: Grams of o2

Input: Temperature in degrees C

The program should then provide output in the following format.

The volume of 32.00 grams of O2

at 0.00 degrees C

and 1.00 atmospheres

is 22.43 liters.

Calculations

The ideal gas law is expressed as:     P*V = N*R*T

P equals pressure in atmospheres (1 atmosphere = pressure at sea level)

V = volume in liters. (This is what the program must calculate.)

N = the quantity of gas, expressed in moles. For o2, moles = grams / 32

R = a gas law constant, 0.0821

T = temperature expressed in Kelvin. Kelvin is calculated as K = degrees C + 272.15

The program will prompt the user for grams of o2, and the temperature in C.

For N, Grams must be converted to moles as shown for “N” above. For T, your Celcius input must be converted to Kelvin as shown above. Assume P = 1 and R equals 0.0821.

With your converted units, calculate for volume. Solving for V, the ideal gas law becomes

V = (N * R * T) / P

Write the script to solve the problem defined ahove.

The catch to this assignment is that the input and the volume calculation must be implemented as functions you write.

I provide you with the main code on the next page.   

You need to write the three functions inputO2, inputTemperatureInC, and calcVasVol.

When your program, run it, showing bad input being rejected and good input being processed. Screenshot the result. Submit your script and screenshot to the drop box.

Explanation / Answer

def volumeOfO2(temp,gram,pressure):
   T = temp + 272.15
   N = gram/32
   P = pressure
   R = 0.0821
   return (N*R*T)/P
  
print volumeOfO2(0,32,1)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote