Question: Please Answer both (a) and (b). They are two parts of the same question. Will give thumbs up and good review if both parts are

Please Answer both (a) and (b). They are two parts of the same question. Will give thumbs up and good review if both parts are answered.
Create a program to calculate the area and perimeter of a square - the program consists of (a) A class that accepts the length of the square and encapsulates calculation of area & perimeter The class should have two constructor, one that accepts length as the argument and another that doesn't accept any arguments. . Methods: o Set length o Return area o Return perimeter Assume length is of type "integer" (b) A test program that uses the square class (from the step above) (b) A test program that uses the square class (from the step above) . Create a square object (instance of class) that sets length to 7 (through the constructor) Create another square object, that calls the constructor without any arguments; set the length of the square to 10 Print the area and perimeter of both squares o 1st square: area : 49, perimeter: 28 o 2nd square: area: 100, perimeter: 40
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
