Hi could someone help me, i have this menu and i want the user to input the correct number for the program then it runs it. this is my code for the menu
#include <iostream>
usingnamespace std;
int main()
{
int choice;
cout<< "Maths Helper";
cout<< "\n\n**************************************\n";
cout<< "\n\n Please choose one of the following:\n";
cout<< "\n\n 1 - Area of a circle ";
cout<< "\n 2 - Circumference of a circle ";
cout<< "\n 3 - Factorial of a number ";
cout<< "\n 4 - Hypotenuse of a triangle ";
cout<< "\n 5 - Exit";
cout<< "\n\n\n**************************************\n";
cout<< "\n\n Enter you choice and press return:";
cin>>choice;
switch (choice)
{
case 1:
cout<< "\n\nArea of a circle ";
break;
case 2:
cout<< "Circumference of a circle ";
break;
case 3:
cout<< "Factorial of a number ";
break;
case 4:
cout<< "Hypotenuse of a triangle ";
break;
case 5:
cout<< "Exit";
break;
default:
cout<< "\nNot a valid choice.";
cout<< "\nchoose again";
cin>> choice;
break;
}
return 0;
}
Do you actually want to invoke different executables for each case (which is what your thread title suggests), or you just want help with implementing the maths for each case?