Professional Documents
Culture Documents
Menu System
1 – converting ft to inch (1st way)
2 – Area of a circle (2nd way)
3 – Exit
Do You Want to Try again? (y/n)
#include <iostream>
#include <string>
float pie()
return(3.1416);
void convert()
in = ft / 12;
cout << "The converted value is: " << in << " inches." << endl;
int main()
{
start:
int choice;
switch (choice)
case 1:
convert();
break;
case 2:
double A, r;
cout << "Please enter the value of the radius of the circle:" << endl;
cin >> r;
A = (pie() * (r * r));
cout << "The area of the circle is: " << A << endl;
break;
case 3:
goto exit;
break;
default:
goto start;
break;
exit:
string decision;
cout << "Do you want to try again? Y/N" << endl;
if (true)
if (decision == "Y")
goto start;
else
system ("pause");
return EXIT_SUCCESS;