Cody

Solution 218909

Submitted on 19 Mar 2013 by andrea84
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   Pass
%% z = 1; y_correct = 'H'; assert(isequal(atomicNumber(z),y_correct))

elements = Columns 1 through 13 'H' 'He' 'Li' 'Be' 'B' 'C' 'N' 'O' 'F' 'Ne' 'Na' 'Mg' 'Al' Columns 14 through 25 'Si' 'P' 'S' 'Cl' 'Ar' 'K' 'Ca' 'Sc' 'Ti' 'V' 'Cr' 'Mn' Columns 26 through 37 'Fe' 'Co' 'Ni' 'Cu' 'Zn' 'Ga' 'Ge' 'As' 'Se' 'Br' 'Kr' 'Rb' Columns 38 through 49 'Sr' 'Y' 'Zr' 'Nb' 'Mo' 'Tc' 'Ru' 'Rh' 'Pd' 'Ag' 'Cd' 'In' Columns 50 through 61 'Sn' 'Sb' 'Te' 'I' 'Xe' 'Cs' 'Ba' 'Ce' 'Pr' 'Nd' 'Pm' 'Sm' Columns 62 through 73 'Eu' 'Gd' 'Tb' 'Dy' 'Ho' 'Er' 'Tm' 'Yb' 'Lu' 'Hf' 'Ta' 'W' Columns 74 through 85 'Re' 'Os' 'Ir' 'Pt' 'Au' 'Hg' 'Tl' 'Pb' 'Bi' 'Po' 'At' 'Rn' Columns 86 through 97 'Fr' 'Ra' 'Th' 'Pa' 'U' 'Np' 'Pu' 'Am' 'Cm' 'Bk' 'Cf' 'Es' Columns 98 through 109 'Fm' 'Md' 'No' 'Lr' 'Rf' 'Db' 'Sg' 'Bh' 'Hs' 'Mt' 'Ds' 'Rg' Columns 110 through 118 'Cn' 'Uut' 'Fl' 'Uup' 'Lv' 'Uus' 'Uuo' 'Uue' 'Ubn' ans = H

2   Pass
%% z = 3; y_correct = 'Li'; assert(isequal(atomicNumber(z),y_correct))

elements = Columns 1 through 13 'H' 'He' 'Li' 'Be' 'B' 'C' 'N' 'O' 'F' 'Ne' 'Na' 'Mg' 'Al' Columns 14 through 25 'Si' 'P' 'S' 'Cl' 'Ar' 'K' 'Ca' 'Sc' 'Ti' 'V' 'Cr' 'Mn' Columns 26 through 37 'Fe' 'Co' 'Ni' 'Cu' 'Zn' 'Ga' 'Ge' 'As' 'Se' 'Br' 'Kr' 'Rb' Columns 38 through 49 'Sr' 'Y' 'Zr' 'Nb' 'Mo' 'Tc' 'Ru' 'Rh' 'Pd' 'Ag' 'Cd' 'In' Columns 50 through 61 'Sn' 'Sb' 'Te' 'I' 'Xe' 'Cs' 'Ba' 'Ce' 'Pr' 'Nd' 'Pm' 'Sm' Columns 62 through 73 'Eu' 'Gd' 'Tb' 'Dy' 'Ho' 'Er' 'Tm' 'Yb' 'Lu' 'Hf' 'Ta' 'W' Columns 74 through 85 'Re' 'Os' 'Ir' 'Pt' 'Au' 'Hg' 'Tl' 'Pb' 'Bi' 'Po' 'At' 'Rn' Columns 86 through 97 'Fr' 'Ra' 'Th' 'Pa' 'U' 'Np' 'Pu' 'Am' 'Cm' 'Bk' 'Cf' 'Es' Columns 98 through 109 'Fm' 'Md' 'No' 'Lr' 'Rf' 'Db' 'Sg' 'Bh' 'Hs' 'Mt' 'Ds' 'Rg' Columns 110 through 118 'Cn' 'Uut' 'Fl' 'Uup' 'Lv' 'Uus' 'Uuo' 'Uue' 'Ubn' ans = Li

3   Pass
%% z = 5; y_correct = 'B'; assert(isequal(atomicNumber(z),y_correct))

elements = Columns 1 through 13 'H' 'He' 'Li' 'Be' 'B' 'C' 'N' 'O' 'F' 'Ne' 'Na' 'Mg' 'Al' Columns 14 through 25 'Si' 'P' 'S' 'Cl' 'Ar' 'K' 'Ca' 'Sc' 'Ti' 'V' 'Cr' 'Mn' Columns 26 through 37 'Fe' 'Co' 'Ni' 'Cu' 'Zn' 'Ga' 'Ge' 'As' 'Se' 'Br' 'Kr' 'Rb' Columns 38 through 49 'Sr' 'Y' 'Zr' 'Nb' 'Mo' 'Tc' 'Ru' 'Rh' 'Pd' 'Ag' 'Cd' 'In' Columns 50 through 61 'Sn' 'Sb' 'Te' 'I' 'Xe' 'Cs' 'Ba' 'Ce' 'Pr' 'Nd' 'Pm' 'Sm' Columns 62 through 73 'Eu' 'Gd' 'Tb' 'Dy' 'Ho' 'Er' 'Tm' 'Yb' 'Lu' 'Hf' 'Ta' 'W' Columns 74 through 85 'Re' 'Os' 'Ir' 'Pt' 'Au' 'Hg' 'Tl' 'Pb' 'Bi' 'Po' 'At' 'Rn' Columns 86 through 97 'Fr' 'Ra' 'Th' 'Pa' 'U' 'Np' 'Pu' 'Am' 'Cm' 'Bk' 'Cf' 'Es' Columns 98 through 109 'Fm' 'Md' 'No' 'Lr' 'Rf' 'Db' 'Sg' 'Bh' 'Hs' 'Mt' 'Ds' 'Rg' Columns 110 through 118 'Cn' 'Uut' 'Fl' 'Uup' 'Lv' 'Uus' 'Uuo' 'Uue' 'Ubn' ans = B

4   Pass
%% z = 7; y_correct = 'N'; assert(isequal(atomicNumber(z),y_correct))

elements = Columns 1 through 13 'H' 'He' 'Li' 'Be' 'B' 'C' 'N' 'O' 'F' 'Ne' 'Na' 'Mg' 'Al' Columns 14 through 25 'Si' 'P' 'S' 'Cl' 'Ar' 'K' 'Ca' 'Sc' 'Ti' 'V' 'Cr' 'Mn' Columns 26 through 37 'Fe' 'Co' 'Ni' 'Cu' 'Zn' 'Ga' 'Ge' 'As' 'Se' 'Br' 'Kr' 'Rb' Columns 38 through 49 'Sr' 'Y' 'Zr' 'Nb' 'Mo' 'Tc' 'Ru' 'Rh' 'Pd' 'Ag' 'Cd' 'In' Columns 50 through 61 'Sn' 'Sb' 'Te' 'I' 'Xe' 'Cs' 'Ba' 'Ce' 'Pr' 'Nd' 'Pm' 'Sm' Columns 62 through 73 'Eu' 'Gd' 'Tb' 'Dy' 'Ho' 'Er' 'Tm' 'Yb' 'Lu' 'Hf' 'Ta' 'W' Columns 74 through 85 'Re' 'Os' 'Ir' 'Pt' 'Au' 'Hg' 'Tl' 'Pb' 'Bi' 'Po' 'At' 'Rn' Columns 86 through 97 'Fr' 'Ra' 'Th' 'Pa' 'U' 'Np' 'Pu' 'Am' 'Cm' 'Bk' 'Cf' 'Es' Columns 98 through 109 'Fm' 'Md' 'No' 'Lr' 'Rf' 'Db' 'Sg' 'Bh' 'Hs' 'Mt' 'Ds' 'Rg' Columns 110 through 118 'Cn' 'Uut' 'Fl' 'Uup' 'Lv' 'Uus' 'Uuo' 'Uue' 'Ubn' ans = N

5   Pass
%% z = 22; y_correct = 'Ti'; assert(isequal(atomicNumber(z),y_correct))

elements = Columns 1 through 13 'H' 'He' 'Li' 'Be' 'B' 'C' 'N' 'O' 'F' 'Ne' 'Na' 'Mg' 'Al' Columns 14 through 25 'Si' 'P' 'S' 'Cl' 'Ar' 'K' 'Ca' 'Sc' 'Ti' 'V' 'Cr' 'Mn' Columns 26 through 37 'Fe' 'Co' 'Ni' 'Cu' 'Zn' 'Ga' 'Ge' 'As' 'Se' 'Br' 'Kr' 'Rb' Columns 38 through 49 'Sr' 'Y' 'Zr' 'Nb' 'Mo' 'Tc' 'Ru' 'Rh' 'Pd' 'Ag' 'Cd' 'In' Columns 50 through 61 'Sn' 'Sb' 'Te' 'I' 'Xe' 'Cs' 'Ba' 'Ce' 'Pr' 'Nd' 'Pm' 'Sm' Columns 62 through 73 'Eu' 'Gd' 'Tb' 'Dy' 'Ho' 'Er' 'Tm' 'Yb' 'Lu' 'Hf' 'Ta' 'W' Columns 74 through 85 'Re' 'Os' 'Ir' 'Pt' 'Au' 'Hg' 'Tl' 'Pb' 'Bi' 'Po' 'At' 'Rn' Columns 86 through 97 'Fr' 'Ra' 'Th' 'Pa' 'U' 'Np' 'Pu' 'Am' 'Cm' 'Bk' 'Cf' 'Es' Columns 98 through 109 'Fm' 'Md' 'No' 'Lr' 'Rf' 'Db' 'Sg' 'Bh' 'Hs' 'Mt' 'Ds' 'Rg' Columns 110 through 118 'Cn' 'Uut' 'Fl' 'Uup' 'Lv' 'Uus' 'Uuo' 'Uue' 'Ubn' ans = Ti

6   Pass
%% z = 15; y_correct = 'P'; assert(isequal(atomicNumber(z),y_correct))

elements = Columns 1 through 13 'H' 'He' 'Li' 'Be' 'B' 'C' 'N' 'O' 'F' 'Ne' 'Na' 'Mg' 'Al' Columns 14 through 25 'Si' 'P' 'S' 'Cl' 'Ar' 'K' 'Ca' 'Sc' 'Ti' 'V' 'Cr' 'Mn' Columns 26 through 37 'Fe' 'Co' 'Ni' 'Cu' 'Zn' 'Ga' 'Ge' 'As' 'Se' 'Br' 'Kr' 'Rb' Columns 38 through 49 'Sr' 'Y' 'Zr' 'Nb' 'Mo' 'Tc' 'Ru' 'Rh' 'Pd' 'Ag' 'Cd' 'In' Columns 50 through 61 'Sn' 'Sb' 'Te' 'I' 'Xe' 'Cs' 'Ba' 'Ce' 'Pr' 'Nd' 'Pm' 'Sm' Columns 62 through 73 'Eu' 'Gd' 'Tb' 'Dy' 'Ho' 'Er' 'Tm' 'Yb' 'Lu' 'Hf' 'Ta' 'W' Columns 74 through 85 'Re' 'Os' 'Ir' 'Pt' 'Au' 'Hg' 'Tl' 'Pb' 'Bi' 'Po' 'At' 'Rn' Columns 86 through 97 'Fr' 'Ra' 'Th' 'Pa' 'U' 'Np' 'Pu' 'Am' 'Cm' 'Bk' 'Cf' 'Es' Columns 98 through 109 'Fm' 'Md' 'No' 'Lr' 'Rf' 'Db' 'Sg' 'Bh' 'Hs' 'Mt' 'Ds' 'Rg' Columns 110 through 118 'Cn' 'Uut' 'Fl' 'Uup' 'Lv' 'Uus' 'Uuo' 'Uue' 'Ubn' ans = P

7   Pass
%% z = 13; y_correct = 'Al'; assert(isequal(atomicNumber(z),y_correct))

elements = Columns 1 through 13 'H' 'He' 'Li' 'Be' 'B' 'C' 'N' 'O' 'F' 'Ne' 'Na' 'Mg' 'Al' Columns 14 through 25 'Si' 'P' 'S' 'Cl' 'Ar' 'K' 'Ca' 'Sc' 'Ti' 'V' 'Cr' 'Mn' Columns 26 through 37 'Fe' 'Co' 'Ni' 'Cu' 'Zn' 'Ga' 'Ge' 'As' 'Se' 'Br' 'Kr' 'Rb' Columns 38 through 49 'Sr' 'Y' 'Zr' 'Nb' 'Mo' 'Tc' 'Ru' 'Rh' 'Pd' 'Ag' 'Cd' 'In' Columns 50 through 61 'Sn' 'Sb' 'Te' 'I' 'Xe' 'Cs' 'Ba' 'Ce' 'Pr' 'Nd' 'Pm' 'Sm' Columns 62 through 73 'Eu' 'Gd' 'Tb' 'Dy' 'Ho' 'Er' 'Tm' 'Yb' 'Lu' 'Hf' 'Ta' 'W' Columns 74 through 85 'Re' 'Os' 'Ir' 'Pt' 'Au' 'Hg' 'Tl' 'Pb' 'Bi' 'Po' 'At' 'Rn' Columns 86 through 97 'Fr' 'Ra' 'Th' 'Pa' 'U' 'Np' 'Pu' 'Am' 'Cm' 'Bk' 'Cf' 'Es' Columns 98 through 109 'Fm' 'Md' 'No' 'Lr' 'Rf' 'Db' 'Sg' 'Bh' 'Hs' 'Mt' 'Ds' 'Rg' Columns 110 through 118 'Cn' 'Uut' 'Fl' 'Uup' 'Lv' 'Uus' 'Uuo' 'Uue' 'Ubn' ans = Al

8   Pass
%% z = 10; y_correct = 'Ne'; assert(isequal(atomicNumber(z),y_correct))

elements = Columns 1 through 13 'H' 'He' 'Li' 'Be' 'B' 'C' 'N' 'O' 'F' 'Ne' 'Na' 'Mg' 'Al' Columns 14 through 25 'Si' 'P' 'S' 'Cl' 'Ar' 'K' 'Ca' 'Sc' 'Ti' 'V' 'Cr' 'Mn' Columns 26 through 37 'Fe' 'Co' 'Ni' 'Cu' 'Zn' 'Ga' 'Ge' 'As' 'Se' 'Br' 'Kr' 'Rb' Columns 38 through 49 'Sr' 'Y' 'Zr' 'Nb' 'Mo' 'Tc' 'Ru' 'Rh' 'Pd' 'Ag' 'Cd' 'In' Columns 50 through 61 'Sn' 'Sb' 'Te' 'I' 'Xe' 'Cs' 'Ba' 'Ce' 'Pr' 'Nd' 'Pm' 'Sm' Columns 62 through 73 'Eu' 'Gd' 'Tb' 'Dy' 'Ho' 'Er' 'Tm' 'Yb' 'Lu' 'Hf' 'Ta' 'W' Columns 74 through 85 'Re' 'Os' 'Ir' 'Pt' 'Au' 'Hg' 'Tl' 'Pb' 'Bi' 'Po' 'At' 'Rn' Columns 86 through 97 'Fr' 'Ra' 'Th' 'Pa' 'U' 'Np' 'Pu' 'Am' 'Cm' 'Bk' 'Cf' 'Es' Columns 98 through 109 'Fm' 'Md' 'No' 'Lr' 'Rf' 'Db' 'Sg' 'Bh' 'Hs' 'Mt' 'Ds' 'Rg' Columns 110 through 118 'Cn' 'Uut' 'Fl' 'Uup' 'Lv' 'Uus' 'Uuo' 'Uue' 'Ubn' ans = Ne

Suggested Problems

More from this Author13