title: Calculate Price Method Not Working In Visual Studio
body: <p>So I've made this form that acts as a cake shop. I have everything working perfectly except for the price. For some reason it isn't displaying properly and shows "$22.60" every time. I'm thinking there might be something wrong with the method</p>
  
  <pre><code>public virtual double CalculateCakeCost()
      {
          return CAKE_PRICE + (LAYER_PRICE * NumOfLayers);
      }
  </code></pre>
  
  <p>from class "Cake" since it seems to return the cake price, but not add it up with the bracket values. The calculate cost with tax method from the class "CustomCake" also seems to be working fine. You can read the rest of the code is down below and please tell me if there is a problem, because I don't see anything wrong.</p>
  
  <pre><code>namespace Lab_OrderCake_The_Bakery_
  {
  
  public partial class frmOrderCake : Form
  {
      Cake objcake;
      CustomCake objcustcake;
      Customer objcustomer;
      Order objorder;
  
      public frmOrderCake()
      {
          InitializeComponent();
      }
  
  
  
      private void btnOrder_Click(object sender, EventArgs e)
      {
          //flavour
          if (radVanilla.Checked == true)
          {
              txtRadFlavour.Text = "Vanilla";
          }
          if (radChocolate.Checked == true)
          {
              txtRadFlavour.Text = "Chocolate";
          }
          if (radBanana.Checked == true)
          {
              txtRadFlavour.Text = "Banana";
          }
          if (radLemonBerry.Checked == true)
          {
              txtRadFlavour.Text = "Lemon banana";
          }
  
          //layers
          if (rad1layer.Checked == true)
          {
              numRadLayers.Value = 1;
          }
          if (rad2layers.Checked == true)
          {
              numRadLayers.Value = 2;
          }
          if (rad3layers.Checked == true)
          {
              numRadLayers.Value = 3;
          }
          if (rad4layers.Checked == true)
          {
              numRadLayers.Value = 4;
          }
  
          //occassion
          if (radAnniversary.Checked == true)
          {
              txtRadOcc.Text = "Anniversary";
          }
          if (radBirthday.Checked == true)
          {
              txtRadOcc.Text = "Birthday";
          }
          if (radRetirement.Checked == true)
          {
              txtRadOcc.Text = "Retirement";
          }
          if (radWedding.Checked == true)
          {
              txtRadOcc.Text = "Wedding";
          }
  
          //size
          if (rad6inch.Checked == true)
          {
              numRadSize.Value = 6;
          }
          if (rad8inch.Checked == true)
          {
              numRadSize.Value = 8;
          }
          if (rad10inch.Checked == true)
          {
              numRadSize.Value = 10;
          }
          if (rad12inch.Checked == true)
          {
              numRadSize.Value = 12;
          }
  
          //design
          if (radPolka.Checked == true)
          {
              txtRadDesign.Text = "Polka Dots";
  
          }
          if (rad8inch.Checked == true)
          {
              txtRadDesign.Text = "Edible Images";
          }
          if (rad10inch.Checked == true)
          {
              txtRadDesign.Text = "Fondant Bow";
          }
          if (rad12inch.Checked == true)
          {
              txtRadDesign.Text = "3D Figures";
          }
  
          objcake = new Cake(txtRadFlavour.Text, (int)numRadLayers.Value);
          objcustomer = new Customer(txtFName.Text, txtLName.Text);
          objcustcake = new CustomCake(txtRadFlavour.Text, (int)numRadLayers.Value, txtRadOcc.Text, 
  (int)numRadSize.Value, txtRadDesign.Text);
          objorder = new Order();
  
          lblOutOrder.Text = objcustomer.ToString() + objcustcake.ToString() + objorder.ToString();
  
      }
  }
  
  
  
  namespace CakeClasses
  {
  public class Cake
  {
      public int NumOfLayers { get; set; }
      public string Flavour { get; set; }
      public double Price { get; set; }
  
      public const double CAKE_PRICE = 20;
  
      public const int LAYER_PRICE = 3;
  
      public Cake()
      {
          Flavour = "";
          NumOfLayers = 0;
      }
  
  
      public Cake(string flavour, int numLayers)
      {
          NumOfLayers = numLayers;
          Flavour = flavour;
      }
  
      **public virtual double CalculateCakeCost()
      {
          return CAKE_PRICE + (LAYER_PRICE * NumOfLayers);
      }**
  
      public override string ToString()
      {
          return " " + Flavour + " flavoured cake with " + NumOfLayers + " layer(s)";
      }
    }
  }
  
  
  
  namespace CakeClasses
  {
  public class Order
  {
      public Customer Customer { get; set; }
      public Cake Cake { get; set; }
      public int NumOfCakes { get; set; }
  
      public Order()
      {
          Customer = new Customer();
          Cake = new Cake();
          NumOfCakes = 1;
      }
  
  
  
      public Order(string fName, string lName, string flavour, int numLayers, string occasion, int 
  diameter, string design)
      {
          Customer = new Customer(fName, lName);
          Cake = new CustomCake(flavour, numLayers, occasion,diameter,design);
          NumOfCakes = 1;
      }
  
  
      public Order(string fName, string lName, string flavour, int numLayers)
      {
          Customer = new Customer(fName, lName);
          Cake = new Cake(flavour, numLayers);
          NumOfCakes = 1;
      }
  
  
      public double CalculateCostWithTax()
      {
          return Cake.CalculateCakeCost() * 1.13;
      }
  
  
      public override string ToString()
      {
          return "for the total cost of " + CalculateCostWithTax().ToString("C");
      }
  }
  }
  
  
  
  namespace CakeClasses
  {
  public class CustomCake : Cake
  {
      public string Occasion { get; set; }
      public int Size { get; set; }
      public string Design { get; set; }
      private double DesignCost { get; set; }
  
  
      public CustomCake(string flavour, int numLayers,string occasion, int diameter, string design)
          :base(flavour,numLayers)
      {
          Occasion = occasion;
          Size = diameter;
          Design = design;
           switch (Design)
           {
               case "Polka Dots":
                  DesignCost = 5;
                   break;
               case "Edible Images":
                   DesignCost = 12;
                   break;
               case "Fondant Bow":
                  DesignCost = 10;
                   break;
               default:
                  DesignCost = 15;
                   break;
           }
      }
      public override double CalculateCakeCost()
      {
          return base.CalculateCakeCost() + Size + DesignCost;
      }
      public override string ToString()
      {
          return base.ToString() +  " with " + Design + " design for " + Occasion + " occassion and 
  size is " + Size + " inches " ;
      }
  }
  }
  </code></pre>