this should help you. it asks user to type in 4 digits which is first stored as a string.

then the parseInt and charAt etc. applies the first character of the string to variable 'number1', the 2nd...