Question: (Java Program)In this assignment inspired by the Oracle Academy, youll find a way to draw basic shapes programmatically in customizable sizes. For example (you may

(Java Program)In this assignment inspired by the Oracle Academy, youll find a way to draw basic shapes programmatically in customizable sizes.

For example (you may use * or # for your shapes)

5x4 Rectangle

5x5 isosceles right triangle

Given the assignment2 code on Canvas that contains the main() with several test cases: complete the following two methods:

createRectangle(): This method accepts two arguments for width and height which should be used to print a rectangle

createTriangle(): This method accepts one argument for the size of a leg, which should be used to print an isosceles right triangle

You must not hardcode the shapes or any of the dimensions, but you may use loops, branching, etc.

Do not use Arrays: they are not a part of this assignment.

1. Include comments (as in example code on Canvas and in textbook) and follow standard formatting (as shown in class and in the book);

2. Compile and run without errors;

3. Produce the output per instructions;

4. Use the Java concepts and structures per the instructions, e.g. methods, loops, etc.; overcomplicated logic or code that could be written in a simpler/more straightforward/more efficient/etc. way will likely result in points off.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!