Modify the draw method in the Square class in Figure 8.13a . Instead of prompting the user
Question:
- Modify the draw method in the Square class in Figure 8.13a. Instead of prompting the user for border or solid, the draw method should prompt the user for an interior character and a border character. If the user enters a space for the interior character, the result will look like a border square. If the user enters the same character for both the interior and the border, the result will look like a solid square. If the user enters different characters, the border will look different from the interior. Your new draw method must do all the work of the original draw, drawBorderSquare, drawSolidSquare, drawHorizontalLine, and drawSides methods in Figures 8.13a and 8.13b. That means the drawBorderSquare, drawSolidSquare, drawHorizontalLine, and drawSides methods will be unnecessary.
Figure 8.13a:
- Figure 8.13b:
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean
Question Posted: