String Lab Assignment [loops]

In this lab, you will work with a GUI to validate the input in each text field . Below is a screenshot of the running program.

validate-user-input

 

  1. download the code: Validate Form Loop Version Starter Code 
  2.  If you’re using bluej, you want to run “main” as shown herevalidate-form-bluej
  3. Find the code section shown below. This is the one and only 1 area that you should be editingscreen-shot-code
  4. Validate the user input as described below:
  1. Name
    1. length of 3 >=
    2. only letters (spaces is ok)
  2.  Email
    1. Must include an “@”
    2. Must include a “.”
    3. the “.” must come after the “@”
  3. Phone
    1. XXX-XXX-XXXX
      1. where each”X” must be an integer value
      2. each “-” must be in the correct location
  4. Date of Birth
    1. To convert a String to an integer use Integer.valueOf(String str)
    2. Max age is 110
    3. Minimum accepted age is 18
      1. If the user is less than 18, display the message. “Sorry you must at least 18 years of age for this service”
  5. Password
    1. Length must be at least 5
    2. cannot include the name anywhere inside the password
  6. Zip Code
    1. Each character must be an integer
    2. Length between 3 and 5 , inclusive

 

If the user has no errors, then please show the message “Thanks for submitting your information ” , as shown below

validate-form_thx_for_submitting_V2

 

A  file that does a few test cases (be careful not to overwrite your work)