예제 #1
0
    private double GetTotalCalories()
    {
        double total = 0;

        total += dough.GetCaloriesPerGram();
        foreach (var topping in toppings)
        {
            total += topping.GetCaloriesPerGram();
        }

        return(total);
    }