Witam, podczas przerabiania piątego odcinka kursu C++ robiąc "zadanie domowe" natrafiłem na błąd "no matching function for call to 'Kolo::Kolo(std::string&, float&, float&, float&)' "
Z góry dziękuję za pomoc
#include <iostream>
#include <math.h>
using namespace std;
class Punkt
{
float x,y;
string nazwa;
public:
void wyswietl()
{
cout<<nazwa<<"("<<x<<","<<y<<")"<<endl;
}
Punkt(string n="S", float a=0, float b=0)
{
nazwa = n;
x = a;
y = b;
}
};
class Kolo :public Punkt
{
protected:
float r;
private:
string nazwa;
public:
void wyswietl()
{
cout<<"Kolo o nazwie "<<nazwa<<endl;
cout<<"Srodek kola: ";
Punkt::wyswietl();
cout<<"Promien: "<<r<<endl;
cout<<"Pole kola: "<<M_PI*r*r<<endl;
}
Kolo(string nk="Kolko", string np="S", float a=0, float b=0, float rr=1 )
:Punkt(np,a,b)
{
nazwa = nk;
r = rr;
}
};
class Kula :public Kolo
{
string nazwa;
public:
void wyswietl()
{
cout<<"Kula o nazwie "<<nazwa<<endl;
cout<<"Srodek kuli: ";
Punkt::wyswietl();
cout<<endl;
cout<<"Promien: "<<r<<endl;
cout<<"Objetosc: "<<4/3*M_PI*r*r*r<<endl;
}
Kula(string n="Kulka", string npk = "S", float aa=0, float bb=0, float rr=1)
:Kolo(npk,aa,bb,rr)
{
nazwa = n;
}
};
int main()
{
Kula k1
k1.wyswietl();
return 0;
}