so my program works for the most part, but when I was testing it with cmixii it gave me 911 instead of 992. I don't know where i went wrong. please help.
cmixii does not make sense. cm is 900, but ix is 9 (not ninety). So you subtract one form 10, then add 2, so it is 11. You probably want cmxcii. If you want 911 you write cmxi
There is a C++ function that changes the case of a character, it is useful for switch statements like this, you can convert user input into the preferable case, such as this...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
char userInput;
std::cin >> userInput;
userInput = toupper( userInput ); // this changes input to UPPERCASE!
userInput = tolower( userInput ); //this changes input to LOWERCASE!
switch ( userInput )
{
case A: blahblah;
break;
default: blahblah;
}
//This way, you need not to worry about having to test for both.