title: cannot declare a body because it is marked abstract
body: <p>Hi i'm new in C# console application and i'm using abstract and override but i get stack in the first method in <strong>public abstract double Compute()</strong> i got an error and it says <strong>cannot declare a body because it is marked abstract</strong> please help me. thank you! </p>
  
  <p>`  </p>
  
  <pre><code>abstract class Cake
      {
          public string _flavor, _size;
          public int _quantity;
  
          public Cake(string flavor, string size, int quantity)
          {
              _flavor = flavor;
              _size = size;
              _quantity = quantity;
          }
  
          public abstract double Compute()
          {
              double price;
              if(_flavor == "Chocolate" &amp;&amp; _size == "Regular")
              {
                 price = 250.50;
              }
              else if (_flavor == "Chocolate" &amp;&amp; _size == "Large")
              {
                  price = 450.50;
              }
              else if (_flavor == "Strawberry" &amp;&amp; _size == "Regular")
              {
                  price = 300.50;
              }
              else
              {
                  price = 500.75;
              }
              return price;
          }
      }
  
      class BirthdayCake:Cake
      {
          public int _numOfCandles;
  
          public BirthdayCake(string flavor, string size, int quantity, int numOfCandles):base(flavor,size,quantity)
          {
              _numOfCandles = numOfCandles;
          }
  
          public override double Compute()
          {
              return _numOfCandles * 10.00;
          }
      }`
  </code></pre>