Esempio n. 1
0
 private static void SecondVal(Calculator calc)
 {
     Console.Write("Enter another number: ");
     string s = Console.ReadLine();
     if (calc.ParseInt(s))
     {
         calc.y = Convert.ToInt32(s);
         Calculation(calc);
     }
     else // Go back 1 step
     {
         Console.WriteLine("Not a number.");
         SecondVal(calc);
     }
 }
Esempio n. 2
0
 private static void InitCalculator(Calculator calc)
 {
     Console.Write("Enter a number: ");
     string s = Console.ReadLine();
     if (calc.ParseInt(s))
     {
         calc.x = Convert.ToInt32(s);
         SecondVal(calc);
     }
     else // Go back 1 step
     {
         Console.WriteLine("Not a number.");
         string[] args = new string[0];
         Main(args);
     }
 }