Hi i'm new in C# console application and i'm using abstract and override but i get stack in the first method in public abstract double Compute() i got an error and it says cannot declare a body because it is marked abstract please help me. thank you!
`
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" && _size == "Regular")
{
price = 250.50;
}
else if (_flavor == "Chocolate" && _size == "Large")
{
price = 450.50;
}
else if (_flavor == "Strawberry" && _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;
}
}`