I am working on this program to store 5 strings and turn them into variables, And then running them through the MAD (Mean, Absolute, Deviation) equations. And by "User Inputed String", I mean a number so its, Input -> String -> Int -> Equation.
So, by string you mean, for instance "five" or "5"? In the first case, you need a lookup table that translates the string "five" to the int 5. In the latter case, you can use the function atoi(). The breakdown of the program is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13
usingnamespace std;
int main()
{
cout << "Enter strings: ";
string astr[5];
int i = 0;
while (i < 5) cin >> astr[i++];
int a[5];
// lookup or convert the elements of astr to a
// apply equations
return 0;
}