#include <iostream>
#include <string>
usingnamespace std;
int again();
int close();
#define pie 22/7
double radius;
int x = 0;
longdouble circle;
longdouble sq;
string y;
int main()
{
cout<<"\tThis tool by Aceix is used to determine the area of a circle";
cout<<"\n\n\nPlease enter the radius of the circle: ";
cin>>radius;
sq = radius * radius;
circle = pie * sq;
cout<<"\n\nThe area of the circle is: "<<circle;
cout<<"\n\nDo you want want to calculate more(y/n):";
cin>>y;
y == "y" ? again() : close();
cin.ignore();
cin.get();
}
int again()
{
do {
if(x >= 1)
cout<<"\n\n\nEnter the radius of the circle: ";
else
cout<<"\n\n\nThen enter the radius of the circle: ";
cin>>radius;
sq = radius * radius;
circle = pie * sq;
cout<<"\n\nThe area of the circle is: "<<circle;
x++;
cin.ignore();
cin.get();
if(x == 10) {
cout<<"\n\nYou have used this tool 10 times. Please re-launch it.";
cin.get();
return 0;
}
} while(x < 10);
}
int close()
{
if(y == "n")
cout<<"Thanks...";
else
cout<<"Wrong input\nExiting...";
return 0;
}