Add a control test

If the user enters a negative value, the program will quit.