Question: 5. Create a method to plot the shape objects on a drawing panel. Note: A square can be constructed by just passing equal values for
5. Create a method to plot the shape objects on a drawing panel. Note: A square can be constructed by just passing equal values for length and breadth. Likewise, a rhombus can be constructed by passing equal values for length and breadth to a parallelogram. The only difference between a rectangle/square and parallelogram/rhombus is that the rectangle/square will have all angles as right angles. But this will not alter the way in which you calculate the area and the perimeter. Client Code: Your client code must create objects of different shapes by passing the respective arguments and must display the results of perimeter and area for each of the objects. You must read from a text file that contains the number of shapes in the first line followed by the lengths/angles information in the subsequent lines. You must read these data from the text file and store them as an array of Shapes (Array of Objects). You client code must also display the shape on a drawing panel 5. Create a method to plot the shape objects on a drawing panel. Note: A square can be constructed by just passing equal values for length and breadth. Likewise, a rhombus can be constructed by passing equal values for length and breadth to a parallelogram. The only difference between a rectangle/square and parallelogram/rhombus is that the rectangle/square will have all angles as right angles. But this will not alter the way in which you calculate the area and the perimeter. Client Code: Your client code must create objects of different shapes by passing the respective arguments and must display the results of perimeter and area for each of the objects. You must read from a text file that contains the number of shapes in the first line followed by the lengths/angles information in the subsequent lines. You must read these data from the text file and store them as an array of Shapes (Array of Objects). You client code must also display the shape on a drawing panel
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
