diff --git a/Mosaic/Company.cs b/Mosaic/Company.cs index 28e57ae..642e9ce 100644 --- a/Mosaic/Company.cs +++ b/Mosaic/Company.cs @@ -42,8 +42,15 @@ public sealed class Company /// Cost estimate for the supplied pattern public decimal GetCostEstimate(TilePattern pattern) { - // TODO - return 0; + double piecesPerHour = CalcPiecesPerHour(pattern.Style); + double hours = pattern.Pieces / piecesPerHour; + + decimal productionCost = pattern.CalcProductionCost(); + decimal workCost = (decimal)hours * _hourlyWage * _workers.Length; + decimal basePrice = (decimal)pattern.Area * _m2Price; + decimal totalCost = basePrice + productionCost + workCost + (productionCost * _profitMargin / 100); + + return Math.Ceiling(totalCost); } ///