I have an equation with 4 variables, I am prompting the user to enter each one of these variables, and then the program decides based on what variables are entered, which variables it needs to solve for. For instance, given variable a and b, I need to solve for b and c. I am trying to come up with a way for the program to decide which variables have been entered, and which ones have not been. This is what I have been thinking so far:
int a,b,c,d;
char unknown;
cout<<"****This program decides which variables to solve for****\n;
cout<<"Please enter the known variables below, if a variable is unknown,
please enter a'?'\n"
cout<< "please enter variable a\n";
cin>>a;
cout<< "please enter variable b\n";
cin>>b;
etc....
if (a =='?'){
check b,c,d}
if (b =='?'){
check c,d}
And then running those variables through if statements to determine which variables are present and which aren't. There has to be an easier way though, these if else if statements have the potential to be ridiculous. If any of you have any advice its much appreciated. Thanks!