Ask the user for the amount of lines they want

Assignment Help JAVA Programming
Reference no: EM132103215

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.

Reference no: EM132103215

Questions Cloud

What threats remain constant from year to year : Why are these threats more common and why are they important? What threats remain constant from year to year? Why?
Estimate the period of oscillation : How should they proceed? You can answer this by studying the behavior of the system for varying initial conditions.
Explain the solicitors for gorgeous gardens : BUSINESS LAW 1018 - Legal Analysis Report - Advise Tom and James whether or not they are entitled to remove (a) the shop counter and (b) the tool shed
Prepare a business report comparing the three vendors : A list of the antivirus and firewall packages you researched. You should research and list at least three different antivirus and firewall packages.
Ask the user for the amount of lines they want : Create a project submission folder, in the form Lab#FirstNameLastName. For example, mine would be Lab5DavidLiu
What single relational algebra operation should be used : What SINGLE relational algebra operation should be used at each local site to extract the relevant tuples from the complete Child table?
Formulate the optimisation problem : Formulate the optimisation problem to minimise the fitting error - Generate the 3D points using a given cylinder; you can choose any N, centre position
How might your company combat these challenges : How might your company combat these challenges? Support your answers with references from the text or course articles.
Write a simple x86 assembly program that set up instruction : Pretend that XOR instruction can't be used, write a simple x86 assembly program that set up some instructions to replace XOR of two bits

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd