Loop practice with validation

using a loop to validate user input