#include #include "digits.h" using namespace std; char DigitToChar(int digit) { char returnValue; if (digit < 10) { returnValue = char('0' + digit); } else if (digit >= 10 and digit <= 36) { returnValue = char ('A' + digit-10); } else { cout << "Error converting " << digit << " to a char " << endl; } return returnValue; } int CharToDigit(char c) { int returnValue = 0; c = toupper(c); if ('0' <= c and c <= '9') { returnValue = c-'0'; } else if ( 'A' <= c and c <= 'Z') { returnValue = 10+c-'A'; } else { cout << "Error coverting '" << c << "' to a digit" << endl; } return returnValue ; }