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

MATLAB PROBLEM MOLAR MASS % Problem{10}: Molar mass is the mass of one mole of a

ID: 3783116 • Letter: M

Question

MATLAB PROBLEM MOLAR MASS

% Problem{10}: Molar mass is the mass of one mole of an element or

% compound. The molar mass of a compound is given by the sum of the

% standard atomic mass of the atoms which form the compound multiplied by

% the molar mass constant, Mu = 1 g/mol. In organic chemistry, compunds

% known as alkanes are made exclusively of Carbon and Hydrogen, connected

% by single bonds. Therefore, given the resources below, where n is the

% number of carbons in the alkane, find the molar mass of the compound to

% two significant digits.

% Example: The molar mass of methane (CH4) is 16.04 g/mol.

% Note: http://en.wikipedia.org/wiki/Relative_atomic_mass,

% http://en.wikipedia.org/wiki/Alkane,

% http://en.wikipedia.org/wiki/List_of_straight-chain_alkanes

% Filename: Molar_Mass_Alkane.m

% Input: n

% Output: Molar_Mass

ANSWER:

n = 4;

Molar_Mass = (12*n) + ((1.01*(2*n)+2));

% Problem{07}: Using what you learned/wrote from Homework_03 - Problem{10}

% (Molar mass calculator), modify the script to report the molar mass for

% the first ten alkanes.

% Filename: molar_mass_alkane.m

% Input: n (1 x 10)

% Output: molar_mass (1 x 10)

Explanation / Answer

For Problem-10:

n=input('Enter the number of carbons in alkane: ');
y=(12*n)+((1.01)*(2*n+2));
disp(y);

For Problem-07:

for n=1:10
y=(12*n)+((1.01)*(2*n+2));
disp(y);
end