Monthly Archives: October 2017

Nested Loops Projects


Nested Loop Starter Code

Method 1) printRectangle()

Change the code from the demonstration of nested loops so that you output the following pattern below. Call this method printSqure()


Method 2 and 3)

diagAndBrders()                                                    noDiag()

diagonal_only                      diagonal

Method 4)




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.



  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. 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



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