
Alex H. answered 12/21/24
Software Engineer with a BS in Computer Science
Assuming this is Java,
The Square class would have a public method get() that calls the accessor function of Equilateral:
public double get() {
return super.get();
}
Square has a public member function, void set(double), that calls the mutator function from Equilateral:
public void set(double length) {
super.set(length);
}
Square has a public member function, double area() const, that returns length times length:
public double area() {
return length * length;
}