这个代码一直跳出does not name a type是什么原因还有怎么解决?

要写一个程序解决计算游泳池栅栏和过道造价的问题,要求是要将造价的计算放到私有里面。
#include"iostream"
#include"string"
using namespace std;

const int AISLE_PRICE=20;

const int FENCE_PAICE=35;

const float PI=3.14;

class circle

{

private:
    float a;
    float b;
        a=AISLE_PRICE*PI*((r+3)^2-(r)^2);
        b=FENCE_PAICE*2*PI*r;
public:
    void get_r(float r)
    {
        cout<<"游泳池半径为"<<r<<endl;
    }
    void price()
    {
        float c;
        float d;
        c=a;
        d=b;
        cout<<"过道的造价为:"<<c<<endl;
        cout<<"栅栏的造价为:"<<d<<endl;
    }

} ;

int main()

{

int r;
cin>>r;
circle c;
c.get_r(r);
c.price();
return 0;

}

他一直跳出“a" does not name a type;"b" does not name a type

有试过改名称或者添加很多头文件,但是还是有这个报错,请问怎么解决呢

图片说明

可以用构造函数,先给r和其他赋值。r赋你输入的值。再写一个私有的函数,这样就可以在私有化里计算r,a,b

问题解决的话,请点下采纳

#include <iostream>

using namespace std;
const int AISLE_PRICE=20;
const int FENCE_PAICE=35;
const float PI=3.14;
class circle
{
private:
    float a;
    float b;
    float r;
public:
    void set_r(float _r)
    {
        r = _r;
        cout<<"游泳池半径为"<<r<<endl;
    }
    void price()
    {
        a=AISLE_PRICE*PI*((r+3)*(r+3)-(r)*r);
        b=FENCE_PAICE*2*PI*r;
        cout<<"过道的造价为:"<<a<<endl;
        cout<<"栅栏的造价为:"<<b<<endl;
    }
} ;
int main()
{
    float r;
    cin>>r;
    circle c;
    c.set_r(r);
    c.price();
    return 0;
}