コード例 #1
0
ファイル: Widget.cs プロジェクト: Nordeus23/WagCorporation
        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());
     }
 }