public int ComputeEmpWage(CompanyEmpWage companyEmpWage) { int empHrs = 0, empWage, totalEmpHours = 0, totalWorkingDays = 0; Random random = new Random(); while (totalWorkingDays < companyEmpWage.numOfWorkingDays && totalEmpHours < companyEmpWage.maxHoursPerMonth) { totalWorkingDays++; int empCheck = random.Next(0, 3); switch (empCheck) { case IS_FULL_TIME: empHrs = 8; totalEmpHours += 8; break; case IS_PART_TIME: empHrs = 4; totalEmpHours += 4; break; default: empHrs = 0; break; } Console.WriteLine("Day= " + totalWorkingDays + " Wage= " + empHrs); } return(totalEmpHours * companyEmpWage.empRatePerHour); }
public void AddCompanyEmpWage(string company, int empRatePerHour, int numOfWorkingDays, int maxHoursPerMonth) { CompanyEmpWage companyEmpWage = new CompanyEmpWage(company, empRatePerHour, numOfWorkingDays, maxHoursPerMonth); companyEmpWageList.Add(companyEmpWage); companyEmpWageMap.Add(company, companyEmpWage); }
public void ComputeEmpWage() { for (int i = 0; i < companyEmpWageList.Count; i++) { CompanyEmpWage company = companyEmpWageList[i]; company.SetTotalEmpWage(this.ComputeEmpWage(company)); Console.WriteLine(company.toString()); } }