Esempio n. 1
0
        public static int ReadIntegerValue(string displayString = "Please enter an Integer Value")
        {
            UserOutput.DisplayOutput(displayString);

            var userValue = ReadConsole();

            return(Int32.Parse(userValue));
        }
Esempio n. 2
0
        internal static FizzBuzzValuePair GetFizzBuzzValuePair(string displayString = "Please Enter Fizz Buzz value and String")
        {
            UserOutput.DisplayOutput(displayString);
            FizzBuzzValuePair fizzBuzzPair;

            fizzBuzzPair.value          = ReadIntegerValue();
            fizzBuzzPair.FizzBuzzString = ReadStringValue("Enter Fizz Buzz String");
            return(fizzBuzzPair);
        }
Esempio n. 3
0
 private int GetRangeValue(string displayString, bool startRange)
 {
     try
     {
         return(UserInput.ReadIntegerValue(displayString));
     }
     catch (FormatException)
     {
         UserOutput.DisplayOutput("Defaulting Value because of bad input");
         return((startRange) ? defaultStartRangeValue : defaultEndRangeValue);
     }
 }
Esempio n. 4
0
 static void Main(string[] args)
 {
     try
     {
         var myFizzBuzz = new FizzBuzz();
         myFizzBuzz.DoFizzBuzz();
     }
     catch (Exception ex)
     {
         UserOutput.DisplayOutput(ex.Message);
     }
 }
Esempio n. 5
0
 public void DoFizzBuzz()
 {
     StartFizzBuzz();
     UserOutput.DisplayOutput(UserOutputStream);
 }
Esempio n. 6
0
        private static string ReadStringValue(string displayString = "Please enter an Input String Value")
        {
            UserOutput.DisplayOutput(displayString);

            return(ReadConsole());
        }