public double CalculatedCalories() { double calories = BaseDoughCalories * weight * validFlourType[FlourType.ToLower()] * validBakingTechnique[BakingTechnique.ToLower()]; return(calories); }
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); }
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; }