예제 #1
0
        public float getWidgetPrice()
        {
            float fTotalPrice = _Price;

            if (_painted.getIsPlated() == true)
            {
                fTotalPrice += _painted.GetTotalPrice();
            }

            return(fTotalPrice);
        }
예제 #2
0
파일: Gadget.cs 프로젝트: docedson/FP3
 public void GetPainted()
 {
     if (_painted.paint.Equals(Painted.Paint.painted) == true)
     {
         Console.WriteLine("The Gadget is " + _painted.paint.ToString() + " " + _painted.color.ToString());
     }
     else if (_painted.paint.Equals(Painted.Paint.plated) == true)
     {
         Console.WriteLine("The Gadget is " + _painted.paint.ToString() + " and has a surcharge of " + _painted.GetTotalPrice().ToString("C2"));
     }
     else
     {
         Console.WriteLine("The Gadget is " + _painted.paint.ToString());
     }
 }