32 lines
504 B
C++
32 lines
504 B
C++
//
|
|
// Created by ahypki on 28.03.23.
|
|
//
|
|
|
|
#include "Square.h"
|
|
|
|
namespace ahypki {
|
|
Square::Square() {
|
|
setName("Square");
|
|
}
|
|
|
|
Square::Square(double x) {
|
|
setName("Square");
|
|
setX(x);
|
|
}
|
|
|
|
double Square::getX() {
|
|
return x;
|
|
}
|
|
|
|
void Square::setX(double newX) {
|
|
x = newX;
|
|
}
|
|
|
|
double Square::computeArea() {
|
|
return getX() * getX();
|
|
}
|
|
|
|
double Square::pureVirtualComputeArea() {
|
|
return getX() * getX();
|
|
}
|
|
} // ahypki
|