Example #1
0
        /// <summary>
        /// define the entry point of the application
        /// </summary>
        /// <param name="args">The arguments.</param>
        public static void Main(string[] args)
        {
            try
            {
                int    choose;
                string yes;
                do
                {
                    Console.WriteLine(" 1.StringReplace \n 2.FlipCoin \n 3.LeapYear \n 4.PowerOfTwo \n 5.HarmonicNumber \n 6.PrimeFactor ");
                    Console.WriteLine(" 7.Gambler \n 8.CouponNumber \n 9.2DArry \n 10.FindTriplets \n 11.FindThedistance \n 12.permutation ");
                    Console.WriteLine(" 13.StopWatch \n 14.TIC_TAC_TOE_GAME \n 15.QudraticEquation \n 16.WindChill");
                    Console.WriteLine("enter the your choose");
                    choose = Convert.ToInt32(Console.ReadLine());
                    switch (choose)
                    {
                    case 0:
                        Environment.Exit(0);
                        break;

                    case 1:
                        StringReplace.Replace();
                        break;

                    case 2:
                        FlipCoin.CoinFlip();
                        break;

                    case 3:
                        LeapYear.Yearleap();
                        break;

                    case 4:
                        PowerOfTwo.TwoToThePower();
                        break;

                    case 5:
                        HarmonicNumber.Harmonicnumber();
                        break;

                    case 6:
                        PrimeFactor.Primefactor();
                        break;

                    case 7:
                        GamblerProgram.Gambler();
                        break;

                    case 8:
                        CouponNumbers.Couponnumbers();
                        break;

                    case 9:
                        TwoDArray.TwodArray();
                        break;

                    case 10:
                        FindTriplets.Integernumber();
                        break;

                    case 11:
                        DistanceProgram.CalculateDistance();
                        break;

                    case 12:
                        Permutation.PermutationNumber();
                        break;

                    case 13:
                        StopWatch.Watch();
                        break;

                    case 14:
                        Tic_Tac_Toe.Tic_tac_toe();
                        break;

                    case 15:
                        QudraticEquation.Equation();
                        break;

                    case 16:
                        WindChill.Wind();
                        break;

                    default:
                        Console.WriteLine("enter the valid choose");
                        break;
                    }

                    Console.WriteLine("do you want continue");
                    yes = Console.ReadLine();
                }   while (choose != 0 && yes != "no");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Example #2
0
        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public static void Main(string[] args)
        {
            try
            {
                int  choice;
                char ch = 'Y';
                do
                {
                    Console.WriteLine(" 0. Exit\n 1. ReplaceString_Program \n 2.HeadsTails_program" +
                                      " \n 3. Leapyear_Program\n 4. CalculatePower_Program \n 5. HarmonicProgram_Program \n " +
                                      "6. PrimeFactors_Program \n 7. Gambler_Program \n 8. CouponNumbers_Program \n 9. TwoDimensionalArray_Program " +
                                      "\n 10. TripleElementAddition_Program \n 11. EuclidianDistance_Program \n 12. PermutationString_Program \n 13. CalculateElapsedTime_Program" +
                                      " \n 14. TicTacToe_Program \n 15. QuadraticFunction_Program \n 16. WindChill_Program");
                    Console.WriteLine("Enter Your Choice");
                    choice = Convert.ToInt32(Console.ReadLine());

                    switch (choice)
                    {
                    case 1:
                        ReplaceString.Replaceletter();
                        break;

                    case 2:
                        HeadsTails.Tosscoin();
                        break;

                    case 3:
                        Leapyear.CheckleapYear();
                        break;

                    case 4:
                        CalculatePower.PowerFunction();
                        break;

                    case 5:
                        HarmonicProgram.Hormonic();
                        break;

                    case 6:
                        PrimeFactors.Primefactor();
                        break;

                    case 7:
                        Gambler.GamblerGame();
                        break;

                    case 8:
                        CouponNumbers.Generatecoupon();
                        break;

                    case 9:
                        TwoDimensionalArray.InputArray();
                        break;

                    case 10:
                        TripleElementAddition.Triple();
                        break;

                    case 11:
                        Distance.CalculateDistance();

                        break;

                    case 12:
                        PermutationString.Permutation();
                        break;

                    case 13:
                        CalculateElapsedTime.ElapsedTimeDifferent();
                        break;

                    case 14:
                        TicTicGame.GameForTicTic();
                        break;

                    case 15:
                        QuadraticFunction.QuadraticMethods();
                        break;

                    case 16:
                        WindChill.CalculateWindChill();
                        break;

                    default:
                        Console.WriteLine("Case not valid plese try again");
                        break;
                    }
                    Console.WriteLine("Enter Y / N For continue:");
                    ch = Convert.ToChar(Console.ReadLine());
                }while (ch != 'N');
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }