Rearrange the following lines of code to produce a class that describes a square with a given side length. Put instance variables and constructors first, then the mutator methods, then the accessor methods in alphabetical order. Not all lines are useful.
^public class Square
+{
+ // instance variables
. private int sideLength;
- private int perimeter;
^ // constructors
. public Square(int initialLength)
+ {
. sidelength = initialLength;
. }
^ // mutators
. public void grow(int amount)
+ {
. sidelength = sidelength + amount;
. }
^ // accessors
+ public int getPerimeter()
+ {
. return 4 * sideLength;
^ }
-return perimeter;
. public int getSideLength()
+ {
- public void getSideLength()
+ {
. return sideLength;
. }
^}