Since you're mixing the extraction operator>> and getline() it is possible that you are getting tripped up by the newline that the extraction operator>> leaves in the input buffer. Try modifying your getline() to : getline(cin >> ws, name); and remember C++ is case sensitive "Hydrogen" is not the same as "hydrogen".
Periodic Table
Enter Name(1), Symbol(2), or atomic Number(3):
1
Enter Name: hydrogen
H
Hydrogen
1
1.008
Exit code: 0 (normal program termination)
BTW Having separate functions for each element is a very cumbersome way of doing things. Arrays and vectors, classes annd structs are key considerations to improving this program.