Пример #1
0
        public double CalculatedCalories()
        {
            double calories = BaseDoughCalories * weight * validFlourType[FlourType.ToLower()] *
                              validBakingTechnique[BakingTechnique.ToLower()];

            return(calories);
        }
Пример #2
0
        private double CalculateDough(string flourType, string techType)
        {
            double flour = FlourType.ValidateType(flourType);

            double technique = BakingTechnique.ValidateTechniques(techType);


            double sum = (2 * weight * flour * technique);

            return(sum);
        }
Пример #3
0
 public Dough(string flourType, string backingTecknique, double weight)
 {
     try
     {
         this.flourType       = (FlourType)Enum.Parse(typeof(FlourType), flourType, true);
         this.bakingTecknique = (BakingTecknique)Enum.Parse(typeof(BakingTecknique), backingTecknique, true);
     }
     catch (Exception e)
     {
         Console.WriteLine("Invalid type of dough.");
         throw;
     }
     this.Weight   = weight;
     this.calories = this.weight * 2;
 }