I am working on a program that will allow the user to make a choice. The program is based on the principles of finding the area of a Rectangle, Circle and Triangle. I want give the user a choice, for example:
A. Area of a Rectangle
B. Area of a Circle
C. Area of a Triangle
cout <<"Enter a letter: ";
cin >> letter;
cout <<"The area of a rectangle is: ";
Now, my question is do I need to define individual variable for A, B, & C, or could I use a string. Once I have completed the my variable, what should I do to make a statement of choice. for example:
if the user chooses A.
should i proceed with and if statement followed by code.
if (A)
{
cout <<" enter the length: ";
cout <<"enter the width: ";
}
I have my programming completed, including the calculations, however I cannot make it work for a choice. for the user to choose either. A || B || C