ran through second, third, and fourth bracket from http://cforbeginners.com/cases_c++.html