Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this one, What is the code in Java? MAKE SURE TO: Create Pattern.java and PatternApp.java LOOK AT UML CLASS DIAGRAM AS WELL

Need help with this one, What is the code in Java?

MAKE SURE TO: Create Pattern.java and PatternApp.java

LOOK AT UML CLASS DIAGRAM AS WELL

Make Sure TO check ALL THAT IT WANTS DONE

Follow the instructions below.

Create the four example patterns below using nested loops and allow the user choose the size(how many lines tall it is)

The user can choose between the four patterns and can be printed/displayed.

The user can choose the size of type Int and chose how tall the design is.

Use a swtich statement to display the right pattern and size.

Refer to the output section below for a reference.

More information below(2 pictures).

image text in transcribed

image text in transcribed

Assignment Pattern Learning Objectives: Understand how loops can be used to achieve a programming goal Practice the use of nested loops Use pseudo-code with a top-down refinement strategy to build algorithms Use a menu to provide the user with choices Use a switch statement to respond to user choices . attern1 ttern2 pattern3 pattern4 Description: In this assignment you allow the user to choose between 4 patterns. Once a pattern has been chosen the user can also specify the desired size. Create a new Java project that includes 2 files: Pattern.java and PatternApp.java Class Pattern: The class Pattern includes 4 methods that print one pattern each. Each pattern includes a parameter called size that corresponds to the number of rows. The patterns above are all of size 5 Here is the UML class diagram of class Pattern No fields and no constructors are specified (the Java compiler will provide a default constructor) All methods are underlined. This indicates that they belong to the type and not toa specific instance. The methods should be called on the type. No instance of class Pattern should be created Pattern Requirements 1. Each pattern looks exactly like displayed above when called with size 5 (same number and type of characters) 2. The size of the pattern displayed corresponds to the size passed as an argument 3. Use nested loops to print the patterns (no switch statements or if statements) Recommendation Develop the algorithms by following a step-wise refinement approach that was introduced in the video and practiced in class. Be diligent when drawing the tables and write down the number of circles, spaces, slashes etc. for each of the lines

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

=+ how might this lead to faster growth in productivity?

Answered: 1 week ago