السلام عليكم
الله يوفق كل من يرد علي ويفتح عليه
الكود ذا اذا سويتله كومبير ما يطلع عندي اخطاء بس عند التشغيل واخترت شكل من الموجود يطلع الجمله الاخيره من الس اش السبب يعني مثلا اخترت السيليندر ونفس الاسبلنغ بس يطلع
" تتوقعون اش السبب الله يوفقكم
The program does not handle
#include<iostream.h>
#include<iomanip.h>
#include<cmath>
const double PI=3.1416;
int main()
{
double height,width,length,radius;
char shape [33] ;
cout<<"Enter the shape type: (rectangle,circle,cylinder)";
cin>>shape;
cout<<endl;
if(shape=="rectangle")
{
cout<<"Enter the width of the rectangle ";
cin>>width;
cout<<endl;
cout<<"Enter the length of the rectangle ";
cin>>length;
cout<<"Perimeter of the rectangle = "<<2*(length+width)<<endl;
cout<<"Area of the rectangle = "<<length*width<<endl;
}
else
if (shape== "circle" )
{
cout<<"Enter the radius of circal "<<endl;
cin>>radius;
cout<<"Area of the citcal = "<<PI*pow(radius,2.0)<<endl;
cout<<setprecision(2);
cout<<"Circumference of the circle:"<<2*PI*pow(radius,2.0)<<endl;
}
else
if(shape=="cylinder")
{
cout<<"Enter the radius of cylinder "<<endl;
cin>>radius;
cout<<"Enter the height of the culinder ";
cin>>height;
cout<<"Volime of the cylinder : "<<PI*pow(radius,2.0)*height<<endl;
cout<<"Surface area of the cylinder : "<<2*radius+2*PI*pow(radius,2.0)<<endl;
}
else
cout<<"The program does not handle "<<shape<<endl;
return 0;
}
