Create a project submission folder in the form


Preliminaries

Create a project submission folder, in the form Lab#FirstNameLastName. For example, mine would be Lab5DavidLiu

Create an Eclipse Java Project.

Add a Java class named PatternMaker to your project

Exercises

Part 1) - For Loop and Pattern Set up -

The majority of the points come from setting up the lab to print patterns appropriately based on user input.

(a) Declare variables to store the following information

(a.1) The type of pattern the user wants (a String)

(a.2) The amount of lines the user wants in the pattern (an int), numLines

(b) Ask the user the pattern they want. It should be either "square" or "rectangle" (noquotes)

(c) Ask the user for the amount of lines they want.

(d) Use the method of your choice (if-elseif-else block or a switch statement) to determine which pattern the user chose. If neither square or rectangle was entered, tell the user to buzz off and end the program.

(e) If the pattern input is rectangle, print out a three wide rectangle of a symbol of your choice (such as *,#, or $) that is numLines lines long using a for loop to print that number of lines. (That is, run the loop from 0 to numLines).

(f) If the pattern input is for square, print out a numLines by numLines square of a symbol of your choice.

This will required the use of print and nested for loops (a for loop for square width and a for loop for square height). Note that the outermost loop (the one that controls height) should print the newlines and the innermost loop (the one that controls width for each new row) should print symbols.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Create a project submission folder in the form
Reference No:- TGS02896670

Now Priced at $15 (50% Discount)

Recommended (98%)

Rated (4.3/5)