/// <summary> /// Defines the entry point of the application /// </summary> /// <param name="args">The arguments.</param> public static void Main(string[] args) { char condition; do { Console.WriteLine("PRESS 1 : TO REPLACE THE STRING NAME"); Console.WriteLine("PRESS 2 : TO FLIPCOIN THE NUMBER"); Console.WriteLine("PRESS 3 : TO ENTER THE 4 DIGIT NUMNER"); Console.WriteLine("PRESS 4 : TO ENTER POWER OF 2"); Console.WriteLine("PRESS 5 : TO ENTER THE NUMBER TO HARMONIC"); Console.WriteLine("PRESS 6 : TO ENTER THE NUMBER TO PRIMEFACOR"); Console.WriteLine("PRESS 7 : TO ENTER THE NUMBERS OF GAMBLERS"); Console.WriteLine("PRESS 8 : TO ENTER THE COUPONS NUMBER"); Console.WriteLine("PRESS 9 : TO ENTER THE ARRAYS ELEMENTS"); Console.WriteLine("PRESS 10 : SUM OF THREE DIGIT ADD INTO ZEROS"); Console.WriteLine("PRESS 11 : FINDING THE DISTANCE FROM POINT TO ORIGION"); Console.WriteLine("PRESS 12 : FINDING THE PERMUTATIONS STRING"); Console.WriteLine("PRESS 13 : TO STOPWATCH"); Console.WriteLine("PRESS 14 : TO TIK TOC PROBLES "); Console.WriteLine("PRESS 15 : TO QUEDRATIC ROOT"); Console.WriteLine("PRESS 16 : TO Windchill prg"); int num = Convert.ToInt32(Console.ReadLine()); switch (num) { case 1: ReplaceString rs = new ReplaceString(); rs.ReplaceString1(); break; case 2: FlipCoin fp = new FlipCoin(); fp.Flip(); break; case 3: LeapYear lp = new LeapYear(); lp.Leapyear(); break; case 4: PowerOf2 p2 = new PowerOf2(); p2.PowersOf2(); break; case 5: Harmonicnum hn = new Harmonicnum(); hn.Harmonic(); break; case 6: PrimeFactor pf = new PrimeFactor(); pf.Prime_Factors(); break; case 7: Gamblers g = new Gamblers(); g.Gambler1(); break; case 8: Coupons cp = new Coupons(); cp.CouponNum(); break; case 9: Arrays2 arr = new Arrays2(); arr.Array2D(); break; case 10: AddToZeros atz = new AddToZeros(); atz.Add3NumbersToZero(); break; case 11: Distance d = new Distance(); d.DistanceToOrigin(); break; case 12: Permutations pr = new Permutations(); pr.StartPermutation(); break; case 13: StopWatch sw = new StopWatch(); sw.ElapsedTime(); break; case 14: TicTacToe ttt = new TicTacToe(); ttt.TicTocToeGame(); break; case 15: Quedratic qd = new Quedratic(); qd.Roots(); break; case 16: WindChill wc = new WindChill(); wc.CalculateWindChill(); break; } Console.WriteLine("ENTER Y TO CONTINUES N TO STOP "); condition = Convert.ToChar(Console.ReadLine()); }while (condition == 'y'); }
/// <summary> /// Defines the entry point of the application. /// </summary> /// <param name="args">The arguments.</param> static void Main(string[] args) { Console.WriteLine("1: Replace String"); Console.WriteLine("2: FlipCoin"); Console.WriteLine("3: Leap Year"); Console.WriteLine("4: Power of 2"); Console.WriteLine("5: Harmonic Number"); Console.WriteLine("6: Prime Factors"); Console.WriteLine("7: Gambler"); Console.WriteLine("8: Coupon Numbers"); Console.WriteLine("9: 2D Array"); Console.WriteLine("10: Sum of Integer Zero"); Console.WriteLine("11: Distance"); Console.WriteLine("12: Permutations"); Console.WriteLine("13: Stop Watch"); Console.WriteLine("14: Tic-Tac-Toe"); Console.WriteLine("15: Quadratic"); Console.WriteLine("16: Wind Chill"); int choice = 0; while (!(choice > 0 && choice < 17)) { try { Console.Write("Enter your choice: "); choice = Convert.ToInt32(Console.ReadLine()); } catch (FormatException) { //Console.WriteLine(Ex); } } //Console.WriteLine(choice); switch (choice) { case 1: ReplaceString replaceString = new ReplaceString(); replaceString.Print(); break; case 2: FlipCoin flip = new FlipCoin(); flip.flipCoin(); break; case 3: LeapYear leap = new LeapYear(); leap.leapYear(); break; case 4: PowerOfTwo powerOfTwo = new PowerOfTwo(); powerOfTwo.printPowerOfTwo(); break; case 5: HarmonicNumber harmonic = new HarmonicNumber(); harmonic.printHarmonicNumber(); break; case 6: Factors factors = new Factors(); factors.printFactors(); break; case 7: Gambler gambler = new Gambler(); gambler.gambling(); break; case 8: CouponNumbers coupon = new CouponNumbers(); coupon.CouponCode(); break; case 9: TwoDArray array = new TwoDArray(); array.input(); break; case 10: SumZero sumZero = new SumZero(); sumZero.checkSumForZero(); break; case 11: Distance distance = new Distance(); distance.calculateDistance(); break; case 12: Permutations permutations = new Permutations(); permutations.permutation(); break; case 13: StopWatch watch = new StopWatch(); watch.simulate(); break; case 14: TicTacToe ticTacToe = new TicTacToe(); ticTacToe.game(); break; case 15: Quadratic quadratic = new Quadratic(); quadratic.roots(); break; case 16: WindChill windChill = new WindChill(); int t = 100; int v = 0; while (!(Math.Abs(t) <= 50 && v <= 120 && v >= 3)) { Console.WriteLine("Enter Temperature and Wind Speed: "); t = Convert.ToInt32(Console.ReadLine()); v = Convert.ToInt32(Console.ReadLine()); } windChill.calculateEffectiveTemperature(t, v); break; default: Console.WriteLine("Wrong Choice!"); break; } }