static void RomanToNumber() { var namer = new SuperbowlNamer(); Console.WriteLine("Please enter a Superbowl Roman numeral to convert and press enter."); var input = Console.ReadLine(); var output = namer.ConvertRoman(input); Console.WriteLine(output); Console.ReadLine(); }
public string ConvertRoman(string input) { try { var romanNumeral = input.ToUpper().ToCharArray(); var result = SuperbowlNamer.NumberBuilder(romanNumeral).ToString(); return(result); } catch { Console.Write("Uh oh you friccin moron, thats not a Roman numeral."); throw (new NonRomanNumeralInputException()); } }
public string ConvertNumber(string input) { try { var num = int.Parse(input); var baseNum = SuperbowlNamer.RomanBase(num); var result = RomanBuilder(baseNum, num); return(result); } catch { Console.Write("Uh oh you friccin moron, thats not a number."); throw (new NonNumberInputException()); } }