I am having a block - I am writing a program that will receive a series of numbers entered in by the user. I need to test to make sure that the number is not negative but also that I truly have a number (not a letter or special character). The first part is easy
if (numbEntered[x] <0)
throw new Exception("enter a number 0 or above")
what I am not sure is how to test for to make sure they entered a number.
Any help is appreciated.
TJ
if (numbEntered[x] <0)
throw new Exception("enter a number 0 or above")
what I am not sure is how to test for to make sure they entered a number.
Any help is appreciated.
TJ