n00b
I'm a cpp noob. Just started taking classes this semester and I am having trouble with strings.
I'm doing a temperature program for class. Pretty basic. Enter temp...enter if it's celsius or fahrenheit and have the program use an if-else statement to have the program convert it to the opposite of what was entered.
I've got all that...but how do I make the program remember if the variable is either celsius or fahrenheit?
For example...
cout << "Please enter if this is celsius or fahrenheit: ";
cin >> x;
What do I name "x" when declaring it as a variable at the beginning of my program? Do I just enter...
"string x"?
Thank you for the help...hope the question made sense.
I'm doing a temperature program for class. Pretty basic. Enter temp...enter if it's celsius or fahrenheit and have the program use an if-else statement to have the program convert it to the opposite of what was entered.
I've got all that...but how do I make the program remember if the variable is either celsius or fahrenheit?
For example...
cout << "Please enter if this is celsius or fahrenheit: ";
cin >> x;
What do I name "x" when declaring it as a variable at the beginning of my program? Do I just enter...
"string x"?
Thank you for the help...hope the question made sense.
