Exemplo n.º 1
0
        public static PoundsAndOunces operator +(PoundsAndOunces x, PoundsAndOunces y)
        {
            PoundsAndOunces c = new PoundsAndOunces
            {
                Pounds = x.Pounds + y.Pounds,
                Ounces = x.Ounces + y.Ounces
            };

            return(c);
        }
Exemplo n.º 2
0
        public int CompareTo(object obj)
        {
            PoundsAndOunces other = (PoundsAndOunces)obj;

            if (Pounds.CompareTo(other.Pounds) < 0)
            {
                return(-1);
            }
            else if (Pounds.CompareTo(other.Pounds) > 0)
            {
                return(1);
            }
            else
            {
                return(Ounces.CompareTo(other.Ounces));
            }
        }
Exemplo n.º 3
0
 public WeighIn(Angler angler, PoundsAndOunces weight)
 {
     Angler = angler;
     Weight = weight;
 }