Cody

Problem 1856. Molecule Atomic Wt (CHONS) Molecules

Solution 3402538

Submitted on 26 Oct 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
eqn='CH4'; mass=atomic_wt(eqn) assert(isequal(mass,16))

mass = []

Assertion failed.

2   Fail
eqn='O2'; mass=atomic_wt(eqn) assert(isequal(mass,32))

mass = []

Assertion failed.

3   Fail
eqn='CO2'; mass=atomic_wt(eqn) assert(isequal(mass,44))

mass = []

Assertion failed.

4   Fail
eqn='C2H6'; mass=atomic_wt(eqn) assert(isequal(mass,30))

mass = []

Assertion failed.

5   Fail
eqn='H2SO4'; % 98 mass=atomic_wt(eqn) assert(isequal(mass,98))

mass = []

Assertion failed.

6   Fail
eqn='SO4'; % 96 mass=atomic_wt(eqn) assert(isequal(mass,96))

mass = []

Assertion failed.

7   Fail
eqn='NO2'; % 46 mass=atomic_wt(eqn) assert(isequal(mass,46))

mass = []

Assertion failed.

8   Pass
eqn='NO'; % 30 mass=atomic_wt(eqn) assert(isequal(mass,30))

mass = 30

Suggested Problems

More from this Author246

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!