Answered step by step
Verified Expert Solution
Question
1 Approved Answer
code in JAVA Break down your work using the Programming Cycle. Create a shape with at least 6 coordinates, but now you have the draw
code in JAVA
Break down your work using the Programming Cycle. Create a shape with at least 6 coordinates, but now you have the draw Line method in Panel2D that also draws diagonal lines: Write a description of your shape in 3 sentences: - store the sentences in your shape; - use each sentence to describe an aspect of the shape; - each sentence should be different for each instance, depending on specific values that are different for each instance (this means you will need to create setter methods). (think how you can use concatenation to keep this simple) Have Border format your shape description into multiple lines that fit within a border box: - width of border box should be maximum 50 chars; - the characters of the description should not be directly beside a border character. For an example of format (not a full description example): * Hello, this is a mes * * sage about a simple * format with a box ar * * ound a string descri * * ption. The Border class should be designed to throw an IllegalArgumentException if there are more than 690 chars when passed a string that will be nearly too large to fit in the Panel 2D display (15 x 50 - 15 x 4). Note that a largest description split across 15 lines would display a border with a height of 19 lines. Have your shape estimate a calculation of its area (use a rectangular estimate). Have the Console output: (i) an instance of your shape, (ii) its description formatted inside a border box, and (ii) its area estimate in the Panel2D display. You decide where to arrange each part of the output, but do not have any overlapping between the three parts. Repeat the Panel2D display three times, clearing out its previous contents, and drawing a different instance of your shape. Each instance should have different values belonging to its data that make it a separate object from the others. Organize the three instances of your shape with an ArrayList in Console. Lastly, have your program demonstrate the IllegalArgumentException does not allow you to pass a string that is too big to Border (simply catch and give a printStackTrace call) Break down your work using the Programming Cycle. Create a shape with at least 6 coordinates, but now you have the draw Line method in Panel2D that also draws diagonal lines: Write a description of your shape in 3 sentences: - store the sentences in your shape; - use each sentence to describe an aspect of the shape; - each sentence should be different for each instance, depending on specific values that are different for each instance (this means you will need to create setter methods). (think how you can use concatenation to keep this simple) Have Border format your shape description into multiple lines that fit within a border box: - width of border box should be maximum 50 chars; - the characters of the description should not be directly beside a border character. For an example of format (not a full description example): * Hello, this is a mes * * sage about a simple * format with a box ar * * ound a string descri * * ption. The Border class should be designed to throw an IllegalArgumentException if there are more than 690 chars when passed a string that will be nearly too large to fit in the Panel 2D display (15 x 50 - 15 x 4). Note that a largest description split across 15 lines would display a border with a height of 19 lines. Have your shape estimate a calculation of its area (use a rectangular estimate). Have the Console output: (i) an instance of your shape, (ii) its description formatted inside a border box, and (ii) its area estimate in the Panel2D display. You decide where to arrange each part of the output, but do not have any overlapping between the three parts. Repeat the Panel2D display three times, clearing out its previous contents, and drawing a different instance of your shape. Each instance should have different values belonging to its data that make it a separate object from the others. Organize the three instances of your shape with an ArrayList in Console. Lastly, have your program demonstrate the IllegalArgumentException does not allow you to pass a string that is too big to Border (simply catch and give a printStackTrace call) Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started