Esempio n. 1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (AirlineClass != null)
         {
             hashCode = hashCode * 59 + AirlineClass.GetHashCode();
         }
         if (ArrivalAirport != null)
         {
             hashCode = hashCode * 59 + ArrivalAirport.GetHashCode();
         }
         if (ArrivalTime != null)
         {
             hashCode = hashCode * 59 + ArrivalTime.GetHashCode();
         }
         if (CarrierCode != null)
         {
             hashCode = hashCode * 59 + CarrierCode.GetHashCode();
         }
         if (ConjunctionTicket != null)
         {
             hashCode = hashCode * 59 + ConjunctionTicket.GetHashCode();
         }
         if (CouponNumber != null)
         {
             hashCode = hashCode * 59 + CouponNumber.GetHashCode();
         }
         if (Date != null)
         {
             hashCode = hashCode * 59 + Date.GetHashCode();
         }
         if (DepartureTime != null)
         {
             hashCode = hashCode * 59 + DepartureTime.GetHashCode();
         }
         if (EndorsementOrRestriction != null)
         {
             hashCode = hashCode * 59 + EndorsementOrRestriction.GetHashCode();
         }
         if (ExchangeTicket != null)
         {
             hashCode = hashCode * 59 + ExchangeTicket.GetHashCode();
         }
         if (Fare != null)
         {
             hashCode = hashCode * 59 + Fare.GetHashCode();
         }
         if (FareBasis != null)
         {
             hashCode = hashCode * 59 + FareBasis.GetHashCode();
         }
         if (Fee != null)
         {
             hashCode = hashCode * 59 + Fee.GetHashCode();
         }
         if (FlightNumber != null)
         {
             hashCode = hashCode * 59 + FlightNumber.GetHashCode();
         }
         if (Number != null)
         {
             hashCode = hashCode * 59 + Number.GetHashCode();
         }
         if (OriginAirport != null)
         {
             hashCode = hashCode * 59 + OriginAirport.GetHashCode();
         }
         if (PassengerClass != null)
         {
             hashCode = hashCode * 59 + PassengerClass.GetHashCode();
         }
         if (ServiceClass != null)
         {
             hashCode = hashCode * 59 + ServiceClass.GetHashCode();
         }
         if (StopoverCode != null)
         {
             hashCode = hashCode * 59 + StopoverCode.GetHashCode();
         }
         if (Taxes != null)
         {
             hashCode = hashCode * 59 + Taxes.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            Console.WriteLine(" 1. Replace String \n 2. FlipCoin \n 3. LeapYear \n 4. PowerOf2 \n 5. HarmonicNo." +
                              " \n 6. PrimeFactor \n 7. WindChill Temperature \n 8. Euclidean distance \n 9. QuadraticEquation " +
                              "\n 10. FindTriplets \n 11. Gambler \n 12. 2DArray \n 13. CouponNumber \n 14. StopWatch \n 15. TicTaeToe" +
                              "\n 16. Vending Machine \n 17. Day of week \n 18. TemperatureConversion \n 19. MonthlyPayment \n 20. SquareRoot" +
                              "\n 21. BinaryConversion \n 22. SwapNibbles \n 23. ResultantNo is Power of two \n 24. BinarySearch \n 25. BubbleSort" +
                              "\n 26. Insertion Sort \n 27. Merge Sort \n 28. Anagram \n 29. Prime btw 1-1000 \n 30. Permutation Recursive \n 31. Permutation Iterartion ");
            int option = Utility.readInt();

            switch (option)
            {
            case 1:
                ReplaceString.Replace();
                break;

            case 2:
                FlipCoin.flipCoin();
                break;

            case 3:
                LeapYear.LeapYears();
                break;

            case 4:
                PowerOf2.PrintTable();
                break;

            case 5:
                Harmonic.HarmonicNo();
                break;

            case 6:
                PrimeFactor.Primefactor();
                break;

            case 7:
                WindChill.Chill();
                break;

            case 8:
                Distance.EuclideanDistance();
                break;

            case 9:
                QuadraticEquation.Quadratic();
                break;

            case 10:
                Sumof3No.SumZero();
                break;

            case 11:
                Gambler.Gambling();
                break;

            case 12:
                Array2D.IntegerArray();
                break;

            case 13:
                CouponNumber.couponNumber();
                break;

            case 14:
                StopWatch.Watch();
                break;

            case 15:
                TicTacToe.TictaeToeGame();
                break;

            case 16:
                VendingMachine.Atm();
                break;

            case 17:
                DayOfWeek.checkday();
                break;

            case 18:
                TemperatureConversion.Conversion();
                break;

            case 19:
                MonthlyPayment.PaymentMonthly();
                break;

            case 20:
                Sqrt.Root();
                break;

            case 21:
                Binary.DecToBinary();
                break;

            case 22:
                BinarySwaapNibble.SwapNibble();
                break;

            case 23:
                ResultantPower2.Resultant();
                break;

            case 24:
                BinarySearch.Search();
                break;

            case 25:
                BubbleSort.Bubblesort();
                break;

            case 26:
                Insertion.InsertionSorting();
                break;

            case 27:
                MergeSort.Mergesorting();
                break;

            case 28:
                Anagram.AnagramString();
                break;

            case 29:
                PrimeNoRange.Range();
                break;

            case 30:
                Permutation.Recursion();
                break;

            case 31:
                permutationIterative.Iterative();
                break;

            case 32:
                PlaindromePrimeNo.AnagramPrime();
                //PlaindromePrimeNo.Palindrome();
                break;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Returns true if AirlineFlightLeg instances are equal
        /// </summary>
        /// <param name="other">Instance of AirlineFlightLeg to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AirlineFlightLeg other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AirlineClass == other.AirlineClass ||
                     AirlineClass != null &&
                     AirlineClass.Equals(other.AirlineClass)
                     ) &&
                 (
                     ArrivalAirport == other.ArrivalAirport ||
                     ArrivalAirport != null &&
                     ArrivalAirport.Equals(other.ArrivalAirport)
                 ) &&
                 (
                     ArrivalTime == other.ArrivalTime ||
                     ArrivalTime != null &&
                     ArrivalTime.Equals(other.ArrivalTime)
                 ) &&
                 (
                     CarrierCode == other.CarrierCode ||
                     CarrierCode != null &&
                     CarrierCode.Equals(other.CarrierCode)
                 ) &&
                 (
                     ConjunctionTicket == other.ConjunctionTicket ||
                     ConjunctionTicket != null &&
                     ConjunctionTicket.Equals(other.ConjunctionTicket)
                 ) &&
                 (
                     CouponNumber == other.CouponNumber ||
                     CouponNumber != null &&
                     CouponNumber.Equals(other.CouponNumber)
                 ) &&
                 (
                     Date == other.Date ||
                     Date != null &&
                     Date.Equals(other.Date)
                 ) &&
                 (
                     DepartureTime == other.DepartureTime ||
                     DepartureTime != null &&
                     DepartureTime.Equals(other.DepartureTime)
                 ) &&
                 (
                     EndorsementOrRestriction == other.EndorsementOrRestriction ||
                     EndorsementOrRestriction != null &&
                     EndorsementOrRestriction.Equals(other.EndorsementOrRestriction)
                 ) &&
                 (
                     ExchangeTicket == other.ExchangeTicket ||
                     ExchangeTicket != null &&
                     ExchangeTicket.Equals(other.ExchangeTicket)
                 ) &&
                 (
                     Fare == other.Fare ||
                     Fare != null &&
                     Fare.Equals(other.Fare)
                 ) &&
                 (
                     FareBasis == other.FareBasis ||
                     FareBasis != null &&
                     FareBasis.Equals(other.FareBasis)
                 ) &&
                 (
                     Fee == other.Fee ||
                     Fee != null &&
                     Fee.Equals(other.Fee)
                 ) &&
                 (
                     FlightNumber == other.FlightNumber ||
                     FlightNumber != null &&
                     FlightNumber.Equals(other.FlightNumber)
                 ) &&
                 (
                     Number == other.Number ||
                     Number != null &&
                     Number.Equals(other.Number)
                 ) &&
                 (
                     OriginAirport == other.OriginAirport ||
                     OriginAirport != null &&
                     OriginAirport.Equals(other.OriginAirport)
                 ) &&
                 (
                     PassengerClass == other.PassengerClass ||
                     PassengerClass != null &&
                     PassengerClass.Equals(other.PassengerClass)
                 ) &&
                 (
                     ServiceClass == other.ServiceClass ||
                     ServiceClass != null &&
                     ServiceClass.Equals(other.ServiceClass)
                 ) &&
                 (
                     StopoverCode == other.StopoverCode ||
                     StopoverCode != null &&
                     StopoverCode.Equals(other.StopoverCode)
                 ) &&
                 (
                     Taxes == other.Taxes ||
                     Taxes != null &&
                     Taxes.Equals(other.Taxes)
                 ));
        }