Example #1
0
 static void Main(string[] args)
 {
     while (true)
     {
         Console.Write("Please enter the type of input (Number / Text / Quit): ");
         string strInput = Console.ReadLine();
         if (strInput.ToLower() == "number")
         {
             Arithmetic arithmetic1 = new Arithmetic();
             arithmetic1.PrintSquareOrSquareRootOrIsPrime();
         }
         else if (strInput.ToLower() == "text")
         {
             TextHelper textHelper1 = new TextHelper();
             textHelper1.PrintCharOrVowel();
         }
         else if (strInput.ToLower() == "quit")
         {
             Console.WriteLine("Bye Bye.");
             break;
         }
         else
         {
             Console.WriteLine("Please enter a valid option.");
         }
     }
 }
Example #2
0
 static void Main(string[] args)
 {
     Console.Write("Please enter the type of input (Number/Text/Quit):");
     string inputType = Console.ReadLine().ToUpper();
     if (inputType == "NUMBER")
     {
        Arithmetic objnew=new Arithmetic();
         objnew.Calculate();
     }
     else if (inputType == "TEXT")
     {
         TextHelper objtext=new TextHelper();
         objtext.FindText();
        }
     else if(inputType == "QUIT")
         Console.Write("Bye Bye!");
     else
     {
         Console.WriteLine("Please enter a valid input!");
     }
 }