#include <iostream>
using namespace std;
int main()
{
int Menu;
double pi = 3.14159265;
double A, r, h, g, a, b;
// A = Area
// r = radius
// h = height
// g = baseline of the Triangle
// a = 1st side of the Rectangle
// b = 2nd side of the Rectangle
do{
cout << "\nChoose an option: ";
cout << "";
cout << " 1 = Circle";
cout << " 2 = Rectangle ";
cout << " 3 = Triangle ";
cout << " 4 = End ";
cout << "" << endl;
cin >> Menu;
if(Menu == 1){
cout << "\nCalculate the Area of a circle";
cout << "\nType in the value for r: ";
cin >> r;
A = r * r * pi;
cout << "The Area of the circle is: " << A;
}
if(Menu == 2){
cout << "\nCalculate the Area of a rectangle: ";
cout << "\nType in the value of a: ";
cin >> a;
cout << "Type in the value of b: ";
cin >> b;
A = a * b;
cout << "The Area of the rectangle is: " << A;
}
if(Menu == 3){
cout << "\nCalculate the Area of a Triangle: ";
cout << "\nType in the value for the height h: ";
cin >> h;
cout << "Type in the value for g: ";
cin >> g;
A = 0.5 * g * h;
cout << "The Area of the triangle is: " << A;
}
if(Menu == 4){
cout << "\nThe End!";
}
if(Menu > 4){
cout << "Error! Not a valid option!";
}
}while(Menu != 4);
return 0;
}