CheckInput

non-final version of Chapter 9-3 assignment