static void Main() { Dog d = new Dog("Doggo", 50.0); FoodItem f = new FoodItem("Pizza", 800.0); Console.WriteLine("{0} weighs {1} pounds!", d.Name, d.Weight); Console.WriteLine("{0} eats a {1}!", d.Name, f.Name); d.eatFood(f); Console.WriteLine("{0} weighs {1} pounds!", d.Name, d.Weight); d.walk(); Console.WriteLine("{0} goes for a walk to lose some weight.", d.Name); Console.WriteLine("{0} weighs {1} pounds!", d.Name, d.Weight); Dog d2 = new Dog("Doge", 60.0); Console.WriteLine("{0} weighs {1} pounds!", d2.Name, d2.Weight); d2.eatDog(d); Console.WriteLine("{0} eats {1}!!!", d2.Name, d.Name); Console.WriteLine("{0} weighs {1} pounds!", d2.Name, d2.Weight); }
public void eatFood(FoodItem f) { Weight += (f.Calories / 100); }