public int ComputeEmpWage(CompanyEmpWage companyEmpWage) { int totalEmpHours = 0; int workingDays = 0; int empHours = 0; int totalWagePerDay = 0; int totalWagePerMonth = 0; while (totalEmpHours < companyEmpWage.maxHoursPerMonth && workingDays < companyEmpWage.numOfWorkingDays) { EmpWageBuilder empWageBuilder = new EmpWageBuilder(); empHours = empWageBuilder.GetWorkingHours(); if (totalEmpHours == 96) { empHours = 4; } if (empHours != 0) { workingDays++; totalEmpHours = empHours + totalEmpHours; totalWagePerDay = empHours * companyEmpWage.ratePerHours; totalWagePerMonth += totalWagePerDay; Console.WriteLine("Total Wage per Day.." + totalWagePerDay); } } return(totalWagePerMonth); }
public void AddCompanyEmpWage(string company, int empRatePerHour, int numOfWorkingDays, int maxHoursPerMonth) { CompanyEmpWage companyEmpWage = new CompanyEmpWage(company, empRatePerHour, numOfWorkingDays, maxHoursPerMonth); this.companyEmpWagesList.AddLast(companyEmpWage); this.companyToEmpWageMap.Add(company, companyEmpWage); }