Concept explainers
Write a function and program to determine the mass of oxygen gas (formula O2, molecular weight = 32) in a container in units of grams. The function accepts input arguments representing the volume of the container in units of gallons, the temperature in the container in degrees Celsius, and the pressure in the container in units of atmospheres. The function output should be a single formatted string that contains the mass of the oxygen gas formatted to + decimal place followed by the units. For example the strings ‘10.0 grams’ or ‘13.3 grams’ would be samples of the expected output of your function. Note that this function should not generate any output on the screen. The program should prompt the user to input the volume in gallons, the temperature in degrees Celsius, and the pressure in atmospheres, and then call the function to create the formatted string containing the mass. Finally, your program should contain an output statement to display the mass of the oxygen gas in the container. For your test case, you may assume that the user provides 1.25 gallons for the volume of the container, 125 degrees Celsius for the temperature, and 2.5 atmospheres for the pressure in the container.
Sample Input/Output
Want to see the full answer?
Check out a sample textbook solutionChapter 17 Solutions
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
- On an alien planet, the law that expresses the flow of blood through a blood vessel, F, as a function of the radius r of the vessel is f=kr5/2where k is a constant. Certain geological features of this planet produce a gas that changes the radius of blood vessels by 5% at the time of inhalation. What would the corresponding increase in blood flow through the vessel at this time be? Write 1-2 sentences explaining how you found your answer.arrow_forward3) Body mass index (BMI) of a person is a measure of body fat based on height and weight. In U.S. customary units it is calculated by: BMI = 703" %D where W is the person's weight in pounds and h is the heights in inches. Write a MATLAB program in a script file that calculates the BMI. For input the program asks the user to enter his/her weight and height. The pro- gram then calculates the BMI rounded to the nearest tenth. For output the program displays the message: "The BMI is: XX." where XX is the value of the BMI. Determine the BMI of a 68-in.-tall person that weigh162 lb.arrow_forwardQ4: Create a Visual Basic Project to find the value of the following series: h? h4 h3 cos(h) = h – 2! 3! 4! Write the code program so that the value of angle (h) is entered into inputbox. Estimate the value of series (cos(h)) so that the absolute value of any term is greater or equal to 10-6. Display the required number of terms (N) which it used in this series in a text box and display the result of series (cos(h)) in another separate text box.arrow_forward
- A member of your team gives you the following MATLAB program. Your job is to create the function used in the program. H = 30; % height [cm] V = 50; % volume [cm^3] % calculates the radius [cm] of a cone R2 = RadiusCone(H,V);arrow_forwardCable AB has 5.0kN of tension. The tower pivots on the midpoint between A and C, level with the ground. Find the reaction force magnitude in Newtons at the pivot point to maintain static equilibrium.arrow_forwardComplete the following sentence. The function returns true (1) if first n characters of two strings are identical. Submit Answerarrow_forward
- The elevations of the ski jumping hill shown below are as follows: hA = 37 mhB = 2.4 mhC = 5.5 m If the velocity of a ski jumper is measured to be 25.3 m/s at position B, what will be the launch velocity (in m/s) at position C [round your final answer to one decimal place]?arrow_forwardThe amount of time it takes for a pendulum to swing “to-and-fro” through one complete cycle is called the “period” and is calculated using the following equation: where T = period in seconds, I = mass moment of inertia, m = mass of pendulum in kilograms g = gravitational acceleration, 9.8 m/s2, h = effective length of pendulum in meters What is the appropriate unit for I if the preceding equation is to be homogeneous in units? Please show all of your work.arrow_forward2. There were 42 mangoes in each crate. 12 such crates of mangoes were delivered to a factory. 4 mangoes were rotten and had to be thrown away. The remaining mangoes were packed into boxes of 10 mangoes each. Write a numerical expression in MATLAB syntax to represent this situation and then find how many boxes of mangoes were there? OFocus 4:20 AM 28°C Mostly clear 3/26/2022 LG CVENUENS THANOS BOBBLEHEAD AMANLANTE A ON CABIA ANn POCKET YOP! AVENGES KEYCHAIN INFINITY WAR Handy Fan THANOS BOBBLE HEAD IGENA ERANLIA P COs CA ANarrow_forward
- Row indexing: Snow fall records stateSnowRecord contains the amount of snow fall (in cm) for various cities. Rows represent a city and columns represent the snow fall for a given month. Assign citySnow Record with all elements of row rowNum. Ex: If stateSnowRecord is [17.3, 20.3; 4.8, 6.2] and rowNum is 2, then citySnowRecord is [4.8, 6.2]. Function > 6 % 7 % 8 9 10 11 12 13 end function citySnowRecord = Get CitySnowFall (stateSnowRecord, rowNum) 2% Get CitySnow Fall: Returns all snow fall values for city in row rowNum % 4 % Inputs: stateSnowRecord matrix of snow fall records for cities for various months rowNum specified row of stateSnowRecord to return stateSnowRecord = [17.3, 20.3; 4.8, 6.2] Outputs: citySnowRecord - all snow fall values for a given city % Assign citySnowRecord with all elements of a row rowNum. citySnowRecord = stateSnowRecord (rowNum, :); Code to call your function > 1 GetCitySnow Fall([17.3, 20.3; 4.8, 6.2], 2) Previous Assessment: 1 of 2 Tests Passed (50%) Save…arrow_forwardPlease refer to the attached picturs of the problem statement. I have solved a, b, c, and g using kinematics and Newton's Second Law. I'm not sure how to answer d, e and f however. My answers are: a) aT=v0/ts b) ac/t=mu(g)+v0/ts c)truck stops before crate d) unsure e) unsure f) unsure g) mu=[(aTts)2]/[2d0-2v0ts-aTts2] mu=[aTv02]/[g(2d0aT-3v02)]arrow_forwardUsing the graphical method, find the sum of the vectors in each number. Draw your vectors on a separate sheet of paper. Scale 10 units: 1cm 1. A box was pushed with a force of 20 Newtons to the right and 40 Newtons to the left. What is the sum of these vectors?arrow_forward
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY