
#include <iostream>
#include <string>
using namespace std;
int square (int l, int w);
double triangle (double h, double b);
double circle (double r);
int main()
{
	
	double height ,base ,radius , triangle_area , circle_area ;
	int length, width;
	string a;
		do {
		cout<<" Hello, I will help you with common math formulas ";
		cout << "1.square.";
		cout << "2.triangles.";
		cout << "3.circle";
		cout << ">> ";
		int choice;
		cin >> choice;
		
		
	switch(choice){
            case 1:
               cout << "Enter the length of the square: ";
               cin >> length;
	       cout << "Enter the width of the square: ";
               cin >> width;
	  int area;
	  area= square(length, width);
	  cout << "The area of the square is " << area << endl;

                    break;
            case 2:
	 cout << "Enter the height  of the triangle: ";
               cin >> height ;
	 cout << "Enter the base  of the triangle: ";
               cin >> base ;
               triangle_area = triangle(height, base);
   cout << "The area of the triangle is " << triangle_area << endl;
                    
                    break;
            case 3:
               cout << "Enter the circle: ";
               cin >> radius;
	       circle_area = circle (radius);
cout << "The area of the circle is " << circle_area << endl;
                    break;
            
            default:
   cout << "Wrong choice, you have to enter a number between 1 and 3" << endl;
                    break;
	
	cout << "Would you like to exit? (yes/no): ";
                     cin >> a;
	         }
               while ((a == "no") || (a == "n"));
		  return 0;
                  }
}
      
 int square (int l, int w)
{
return l * w;
}
double triangle (double h, double b)
{
return h * b* 0.5;
}
double circle (double r)
{
return 3.14159 * (r * r);
}