
Head First C# Code: Chapter 6
Bee Management System 2
Bee.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace __Bee_Management_System___part_2
{
public class Bee {
public Bee(double weight) {
this.weight = weight;
}
public virtual int ShiftsLeft {
get { return 0; }
}
private double weight;
public virtual double GetHoneyConsumption() {
double consumption;
if (ShiftsLeft == 0)
consumption = 7.5;
else
consumption = 9 + ShiftsLeft;
if (weight > 150)
consumption *= 1.35;
return consumption;
}
}
}