Added revised code for the "for, catch and if" statements to the getInt function