Académique Documents
Professionnel Documents
Culture Documents
double square_area;
square_area = s * s;
return square_area;
int main()
int side,radius,height,base,length,width,other,x=0,y;
int shape[x];
string shapes[]={"Square","Circle","Triangle","Rectangle"};
double area[x];
do
e:
cin>>shape[x];
if(shape[x]==1)
shapes[0];
cout<<"Enter a side:"<<endl;
cin>>side;
cin>>other;
}
else if(shape[x]==2)
shapes[1];
cin>>radius;
cin>>other;
else if(shape[x]==3)
shapes[2];
cin>>height;
cin>>base;
cin>>other;
else if(shape[x]==4)
shapes[3];
cin>>height;
cin>>base;
cout<<"another (1.yes/press any key to stop): ";
cin>>other;
else
goto e;
x++;
}while(other==1);
for(y=0;y<x;y++)
cout<<shapes[y]<<" "<<area[y]<<endl;