Tag: 20791

Assume you have a class Square. This class has an instance variable, side that is protected and of type double. Write the class definition of a subclass of Square called FancySquare that has a method called getDiagonal. The getDiagonal method gets no arguments but returns the value of side multiplied by the square root of two.

Assume you have a class Square. This class has an instance variable, side that is protected and of type double.  Write the class definition of a subclass of Square called FancySquare that has a method called getDiagonal. The getDiagonal method gets no arguments but returns the value of side multiplied by the square root of two.

LANGUAGE: JAVA CHALLENGE: Assume you have a class Square. This class has an instance variable, side that is protected and of type double. Write the class definition of a subclass of Square called FancySquare that has a method called getDiagonal. The getDiagonal method gets no arguments but returns the value of side multiplied by the square […]

Read More