Exemple #1
0
        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public static void Main(string[] args)
        {
            //// To Perform Test Cases atleast once but in this case created infinite loop
            while (true)
            {
                Console.WriteLine();
                Console.WriteLine("Press 1  : Vending Machine");
                Console.WriteLine("Press 2  : Day Of Week");
                Console.WriteLine("Press 3  : Temperature Convertion");
                Console.WriteLine("Press 4  : Monthly Payment");
                Console.WriteLine("Press 5  : Sqrt Newtons Method");
                Console.WriteLine("Press 6  : Permutations Of a String");
                Console.WriteLine("Press 7  : Binary Search The Word From Word List");
                Console.WriteLine("Press 8  : Insertion Sort");
                Console.WriteLine("Press 9  : Bubble Sort");
                Console.WriteLine("Press 10 : Merge Sort");
                Console.WriteLine("Press 11 : An Anagram Detection");
                Console.WriteLine("Press 12 : Prime Numbers b/w Range");
                Console.WriteLine("Press 13 : Question to Find your number");
                Console.WriteLine("Press 14 : Message Demonstration using String Function ");

                int press = Convert.ToInt32(Console.ReadLine());
                switch (press)
                {
                case 1:
                    VendingMachine vendingMachine = new VendingMachine();
                    vendingMachine.CalculateNotes();
                    break;

                case 3:
                    TemperatureConvertion temperatureConvertion = new TemperatureConvertion();
                    temperatureConvertion.ConvertTemperature();
                    break;

                case 4:
                    MonthlyPayment monthlyPayment = new MonthlyPayment();
                    monthlyPayment.CalculatePayment();
                    break;

                case 5:
                    SqrtNewtonMethod sqrtNewtonMethod = new SqrtNewtonMethod();
                    sqrtNewtonMethod.FindSqrtNewtonMethod();
                    break;

                case 8:
                    Insertion_Sort insertion_Sort = new Insertion_Sort();
                    insertion_Sort.PerformInsertionSort();
                    break;

                case 9:
                    Bubble_Sort bubble_Sort = new Bubble_Sort();
                    bubble_Sort.Sort();
                    break;

                case 11:
                    Anagram anagram = new Anagram();
                    anagram.DetectAnagram();
                    break;

                case 12:
                    Prime_Numbers prime_Numbers = new Prime_Numbers();
                    prime_Numbers.CheckPrime();
                    break;

                default:
                    Console.WriteLine("Invalid Choice");
                    break;
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Mains the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public static void Main(string[] args)
        {
            int choice = 0;

            Console.WriteLine("1:Check Anagram\n2:Prime Numbers Bet 1000\n3:Prime Palindrome\n4:Prime Anagram\n5:Binary Sort For Integer\n6:Binary Sort for String\n" +
                              "7:Insertion sort for String\n8:Insertion sort for Integer\n9:Calculate Day Of Week\n10:Temperature Conversion\n11:Monthly Payment\n12:" +
                              "Squere Root\n13:Calculate Binary Numbers\n14:Bubble Sort For Integer\n15:Bubble Sort For String\n16:Binay Search For File\n17:" +
                              "Bubble Sort Using File\n18:Calculate Notes\n19:binary Operation Swapping Nibbles\n20:Merge Sort");
            do
            {
                try
                {
                    Console.WriteLine("Enter Your Choice");
                    choice = int.Parse(Console.ReadLine());
                    switch (choice)
                    {
                    case 1:
                        Utility.CheckAnagram();
                        Console.ReadKey();
                        break;

                    case 2:
                        ArrayList list = Utility.PrimeNumbersbet1000();
                        Utility.ShowList(list);
                        Console.ReadKey();
                        break;

                    case 3:
                        Utility.PrimePalindrome();
                        break;

                    case 4:
                        Utility.PrimeAnagram();
                        Console.ReadKey();
                        break;

                    case 5:
                        Input.InputBinaryforInt();
                        Console.ReadKey();
                        break;

                    case 6:
                        Input.InputBinaryforString();
                        Console.ReadKey();
                        break;

                    case 7:
                        Input.InputInsertionforString();
                        Console.ReadKey();
                        break;

                    case 8:
                        Input.InputInsertionforInt();
                        Console.ReadKey();
                        break;

                    case 9:
                        Utility.DayOfWeek();
                        Console.ReadKey();
                        break;

                    case 10:
                        Utility.TemperaturConversion();
                        Console.ReadKey();
                        break;

                    case 11:
                        Utility.MonthlyPayment();
                        Console.ReadKey();
                        break;

                    case 12:
                        Utility.Sqrt();
                        Console.ReadKey();
                        break;

                    case 13:
                        Input.PrintBinaryDigit();
                        Console.ReadKey();
                        break;

                    case 14:
                        Input.InputBubbleSortforInt();
                        Console.ReadKey();
                        break;

                    case 15:
                        Input.InputBubbleSortforString();
                        Console.ReadKey();
                        break;

                    case 16:
                        Input.BinarySearchUsingFile();
                        Console.ReadKey();
                        break;

                    case 17:
                        Input.BubbleSortUsingFile();
                        Console.ReadKey();
                        break;

                    case 18:
                        VendingMachine.CalculateNotes();
                        Console.ReadKey();
                        break;

                    case 19:
                        Binary.SwapNibbles();
                        Console.ReadKey();
                        break;

                    case 20:
                        Input.MergeSort();
                        Console.ReadKey();
                        break;
                    }
                }
                catch (Exception)
                {
                    Console.WriteLine("Please Enter Correct Input");
                }
            }while (choice != 0);
        }
Exemple #3
0
        /// <summary>
        /// Mains the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public static void Main(string[] args)
        {
            Console.WriteLine("Enter Your Choice");
            int choice = int.Parse(Console.ReadLine());

            do
            {
                switch (choice)
                {
                case 1:
                    Utility.CheckAnagram();
                    Console.ReadKey();
                    break;

                case 2:
                    ArrayList list = Utility.PrimeNumbersbet1000();
                    Utility.ShowList(list);
                    Console.ReadKey();
                    break;

                case 3:
                    Utility.PrimePalindrome();
                    break;

                case 4:
                    Utility.PrimeAnagram();
                    Console.ReadKey();
                    break;

                case 5:
                    Input.InputBinaryforInt();
                    Console.ReadKey();
                    break;

                case 6:
                    Input.InputBinaryforString();
                    Console.ReadKey();
                    break;

                case 7:
                    Input.InputInsertionforString();
                    Console.ReadKey();
                    break;

                case 8:
                    Input.InputInsertionforInt();
                    Console.ReadKey();
                    break;

                case 9:
                    Utility.DayOfWeek();
                    Console.ReadKey();
                    break;

                case 10:
                    Utility.TemperaturConversion();
                    Console.ReadKey();
                    break;

                case 11:
                    Utility.MonthlyPayment();
                    Console.ReadKey();
                    break;

                case 12:
                    Utility.Sqrt();
                    Console.ReadKey();
                    break;

                case 13:
                    Input.PrintBinaryDigit();
                    Console.ReadKey();
                    break;

                case 14:
                    Input.InputBubbleSortforInt();
                    Console.ReadKey();
                    break;

                case 15:
                    Input.InputBubbleSortforString();
                    Console.ReadKey();
                    break;

                case 16:
                    Input.BinarySearchUsingFile();
                    Console.ReadKey();
                    break;

                case 17:
                    Input.BubbleSortUsingFile();
                    Console.ReadKey();
                    break;

                case 18:
                    VendingMachine.CalculateNotes();
                    Console.ReadKey();
                    break;

                case 19:
                    Binary.SwapNibbles();
                    Console.ReadKey();
                    break;
                }
            }while (choice != 0);
        }