Menu

[Solved]Java Project 3 Programmatic Ascii Art Overview Using Text Create Picture Known Ascii Art R Q37121448

Java Project 3: ProgrammaticASCII Art

Overview

Using text to create a picture isknown as ASCII art. This required us to type every character in theart we wanted to create. In this practice, you’ll find a way todraw basic shapes programmatically in customizable sizes. Forexample:

ocument2 - Saved Sign in File Home Insert Design Layout References Mailings Review View HelpTell me what you want to do Share

Task

Complete the following two methods inLoopShape.java:

  • createRectangle(): This method accepts twoarguments for width and height which should be used to print arectangle
  • createTriangle(): This method accepts oneargument for the size of a leg, which should be used to print anisosceles right triangle

Try changing the value of thearguments you’re supplying these two methods from the main method.Make sure your program can successfully draw each shape to a customsize. Additionally, your program must:

  • Refuse to draw shapes with any dimension less than 1
  • Be able to draw shapes with any dimension equal to 1 (a 1x1shape should print just a single character)

If the problem seems difficult,remember to break it into smaller challenges such as:

  • How do I print a single line that is a variable number of “#”characters wide?
  • How do I create a String that begins and ends with a “#”, buthas a variable number of spaces in between?

Finishing each smaller challenge is anaccomplishment. This problem is as much about understanding loopsas it’s about understanding how to break a big problem into smallertasks.

The knowledge you’ve gained in thissection on loops will be very helpful in completing this program.You’re free to use whichever type of loop statements you feel wouldbe best. You’ll also need to remember a few concepts from previoussections.  

LoopShape.java

public class LoopShape {
  
static void createRectangle(int width, int height){
//Draw a Rectangle
  
  
}
  
static void createTriangle(int leg){
//Draw an Isosceles Right Triangle
  
  
}
}

LoopShapeTest.java

public class LoopShapeTest {
public static void main(String[] args) {
  
LoopShape.createRectangle(5, 4);
LoopShape.createTriangle(5);
}   
}

ocument2 – Saved Sign in File Home Insert Design Layout References Mailings Review View HelpTell me what you want to do Share Comments 5×4 Rectangle 5×5 Isosceles Right Triangle 6 wordsL Page 1 ot 1 + 100% Show transcribed image text ocument2 – Saved Sign in File Home Insert Design Layout References Mailings Review View HelpTell me what you want to do Share Comments 5×4 Rectangle 5×5 Isosceles Right Triangle 6 wordsL Page 1 ot 1 + 100%

Expert Answer


Answer to Java Project 3: Programmatic ASCII Art Overview Using text to create a picture is known as ASCII art. This required us t… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *