0

I have my problem on line 44 I don't understand why this happen and how to fix it It say that No default constructor exists for a class "Rectangle" I try to change but it same

#include <iostream>
#include <cmath>
using namespace std;

class Rectangle
{
private:
    double width;
    double height;
public:
    Rectangle(double width, double height);
    double area();
    double circumference();
    double getWidth();
    double getHeight();
};
class SquareRectangle:public Rectangle {
private:
    double side;
public:
    SquareRectangle(double side);
    double getSide();
};




Rectangle::Rectangle(double width, double height){
    this->width = width;
    this->height = height;
}
double Rectangle::area(){
    return M_PI*pow(height,2);
}
double Rectangle::circumference(){
    return  2*(width+height);
}

SquareRectangle::SquareRectangle(double side) {
       this->side  = side;
}

0 Answers0