CSC 120 Lab 7
In this lab we will practice with for loops and drawing repetitive patterns with loops
  - Create a new NetBeans project called Lab7a, and copy source
files to it.
 
 
      - File | New Project, etc. Make sure the Project Location is in
your CSC120\Java folder, and the Project Name is Lab7a. 
 
 
- Right-click on the following link and save this .zip file in your CSC120 folder:
	      
		       Lab7aStarterFiles.zip
		   
- Use Windows Explorer to Extract All from the .zip file you saved in the previous
          step, and then copy BOTH files that were extracted,
	      and paste them in the src folder of your project.
 
 
 
- Run the program.
 
 
      - Run the program as it is given.  Five lines are displayed in the Text Area
	      on screen.  Then examine the program in "Source" view. Look at the
	      source code of the program -- there is only one outputArea.appendstatement inside theforloop
		  (it is spread across several lines), which
		  is executed multiple times because of the loop in the program.
 
 
 
- Make changes to the given program.
 
 
      - Make the value of the variable downtake on the values 7, 14, 21, 28, 35 as the 
	      program is executed.  Use the same type of code to do this as is used in the program to 
		  causeovertake on a series of values.  If you do this properly, the values
		  ofdownshown above will be printed in the Text Area on screen.  
		  Run your program and
		  see if you can obtain correct output.
 
 
- Make the program print 20 lines of output in the Text Area.  Run the program and count to make 
	      sure that 20 lines of output are printed.
 
 
 
- Add code to change other variables.
 
 
      - Inside the body of the constructor method for the MUFrameclass,
    	  declare two moreIntegervariables calledwidthandheight.
 
 
- Make these variables take
		  on the following values:  widthshould start with 700, and repeatedly decrease
		  by 10 each time through the loop;heightshould start with 1, and double itself
		  each time through the loop.
 
 
- Add code to the outputArea.appendstatement inside the loop so that all four 
	      variable values
	      are printed in the Text Area on one line, with appropriate labels preceding each numeric
		  value.
 
 
- Run the program, test, and fix as needed. 
 
 
 
- Create a new NetBeans project called Lab7b, and copy source
files to it.
 
 
	  - Close the current Lab7a project in NetBeans. 
 
 
- Choose "File | New Project, etc." from the NetBeans top-level menu bar.  Make sure 
	  the Project Location is in your CSC120\Java folder, and the Project Name is Lab7b. 
 
 
- Right-click on the following link and save this .zip file in your CSC120 folder:
	      
		       Lab7bStarterFiles.zip
		   
- Use Windows Explorer to Extract All from the .zip file you saved in the previous
          step, and then copy ALL THREE files that were extracted,
	      and paste them in the src folder of your project.
 
 
- Run the program as it is given.  Notice that 7 blue bars are displayed in the output window.  
	      Examine the MUPanel.java file and make sure you understand why the pattern that is drawn shows up as
		  it does.
 
 
 
- Draw patterns using loops.
 
 
      - Change the code in the given MUPanelso that the patterns that may be viewed
	      by clicking  THIS LINK
	      are drawn in the output window.
 
 
- For each of the patterns shown, change the program and run it to produce the pattern, then capture a screen shot image of the output window and save it, either in a Word document or as a .png or .jpg file.
 
 
		      -  In Windows, the keyboard combination [Alt]-[PrtSc] captures a screen shot of the current window, then you can paste the image into a Word document or you can paste it into MS Paint and save it as a separate image file.  Ask your instructor for details if you need help doing this.
 
-  Here is a description of how this works in  Microsoft Windows.  You'll want to do this if you are using the CS Lab Virtual Image, because the image is a virtual Windows computer, no matter what kind of computer you actually have.
 
-  Here are instructions for how to perform a  screen capture in Mac OSX. 
 
 
- 
	  Keep changing the program from pattern to pattern as you go along -- you don't need to keep 
	      each version of the program in a separate NetBeans project (unless you want to do that). 
 
 
- Hint:  each trip through the loop, after all the drawing is done, changing the values
	                  of over,down,widthand/orheightwill cause the next shape to be drawn differently the 
					  next time through the loop.  What is changing in the pattern from
					  shape to shape?  Those variables are what need to be changed inside
					  the loop body.
 
 
- Hint:  to make every other color (or every third color, etc.) change to a 
	      different color, you'll need to use the
	      % operation to calculate the remainder of a division problem.
 
 
- Ask your instructor
		  for help with any pattern you have trouble generating with a loop.
 
 
 
- Submit your Lab7b project for grading.
 
      Be sure that the screenshots of all of your patterns are saved in the srcfolder of your Lab7b NetBeans project folder, and then make a .zip file of the Lab7b folder.  Turn in ONLY the final version of the Lab7b project into 
	  the 
	  D2L dropbox for this assignment.  You are not required to turn in Lab7a for this assignment.