0% found this document useful (0 votes)
18 views2 pages

Htcls

The document is a C++ program that calculates the surface areas of various shapes including circles and rectangles. It prompts the user to choose a shape and input relevant dimensions to compute the area. The program currently implements functionality for circles and rectangles, with placeholders for trapeziums, cones, and cylinders yet to be completed.

Uploaded by

mandeladongmo99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

Htcls

The document is a C++ program that calculates the surface areas of various shapes including circles and rectangles. It prompts the user to choose a shape and input relevant dimensions to compute the area. The program currently implements functionality for circles and rectangles, with placeholders for trapeziums, cones, and cylinders yet to be completed.

Uploaded by

mandeladongmo99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <iostream>

using namespace std;

float cicle(float r){


float s;
const float pi=3.14;
s = pi*r*r;
return s;
}
float rectangle(float len,float wid){
float s;
s = len*wid;
return s;
}

int main()
{
int choix;
cout << "****** WELCOME TO SURFACE AREAS******" << endl;
cout << " TYPE 1 FOR CIRCLE " << endl;
cout << " TYPE 2 FOR RECTANGLE " << endl;
cout << " TYPE 3 FOR TRAPEZIUM " << endl;
cout << " TYPE 4 FOR CONE " << endl;
cout << " TYPE 5 FOR CYLINDER " << endl;

cin >>choix;
switch(choix){
case 1:{
float radius,s;
cout<<" enter the value of the radius "<<endl;
cin>>radius;
s = cicle(radius);
cout<<" La surface de votre cercle de rayon "<<radius<<" = "<<s<<endl;
}
break;
case 2:{
float s , L,l;
cout<<" entrer la longueur et la largeur"<<endl;
cin>>L>>l;
s = rectangle(L,l);
cout<<" La surface du rectangle de longueur "<<L<<" et de largeur "<<l<<" = "<<s<<endl;

}
break;
case 3:{
}
break;
case 4:{

}
break;
case 5:{

}
break;
default :cout<<" Choix non disponible "<<endl;

return 0;
}

You might also like