Question: 3. 2385 Write a code segment that sets the variable gastest to the word OXYGEN, NITROGEN, or CO2 according to the guidelines below Assume the

 3. 2385 Write a code segment that sets the variable gastest

3. 2385 Write a code segment that sets the variable gastest to the word OXYGEN, NITROGEN, or CO2 according to the guidelines below Assume the variable molarmass is defined and is a row vector of a list of the molar mass each molecule in a gas. Each number in the list will either be 28, 32, or 44. Compute the median of the list molarmass and use the median of molarmass to determine if the gas is mostly 'OXYGEN NITROGEN' or 'CO2' using the table. Store the result ('OXYGEN', 'NITROGEN' or 'CO2') in the variable gastest Median molarmass gastest 32 OXYGEN 28 NITROGEN 44 CO2 Notes: Write a code segment, not a function Do not include any test cases in the code you submit. Don't forget end statements Check variable names and spelling in CO2 "O" is a letter molarmass=input('Enter a number for molarmasss: '); gastest="; if(median(molarmass)==32) gastest='OXYGEN'; elseif (median(molarmass) == 28) gastest="NITROGEN'; elseif (median(molarmass) ==44) gastest='CO2'; end disp(gastest) 3. 2385 Write a code segment that sets the variable gastest to the word OXYGEN, NITROGEN, or CO2 according to the guidelines below Assume the variable molarmass is defined and is a row vector of a list of the molar mass each molecule in a gas. Each number in the list will either be 28, 32, or 44. Compute the median of the list molarmass and use the median of molarmass to determine if the gas is mostly 'OXYGEN NITROGEN' or 'CO2' using the table. Store the result ('OXYGEN', 'NITROGEN' or 'CO2') in the variable gastest Median molarmass gastest 32 OXYGEN 28 NITROGEN 44 CO2 Notes: Write a code segment, not a function Do not include any test cases in the code you submit. Don't forget end statements Check variable names and spelling in CO2 "O" is a letter molarmass=input('Enter a number for molarmasss: '); gastest="; if(median(molarmass)==32) gastest='OXYGEN'; elseif (median(molarmass) == 28) gastest="NITROGEN'; elseif (median(molarmass) ==44) gastest='CO2'; end disp(gastest)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!