Write a generic drawRow method having this heading:
private void drawRow(int startCol, int endCol)
startCol and endCol are the column numbers of the left and right borders, respectively. Then modify the Square class’s draw method in Figure 8.7a to draw either a solid square or a solid triangle whose height and width equal the width of the input width of a square container. What about the area now? Is it a redundant value, or is it a legitimate object attribute? Modify the instance variables and the getArea method accordingly. Then drive your modified Square class (call it Square2) with a Square2Driver whose main method looks like this:
public static void main(String[] args){Scanner stdIn = new Scanner(System.in);Square2 square;System.out.print("Enter width of square container: ");square = new Square2(stdIn.nextInt());square.draw();System.out.println("Area = " + square.getArea());} // end mainSample session:
Enter width of square container: 5Print (s)quare or (t)riangle? t***************Area = 15

We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.