Created a method for the key ipput for restarting or exiting the console application