/// <summary> /// Computes the emp wage. /// </summary> /// <returns></returns> private int computeEmpWage(CompanyEmpWage companyEmpWage) { int empHrs = 0, totalEmpHrs = 0, totalWorkingDays = 0; while (totalEmpHrs <= companyEmpWage.maxHrsPerMonth && totalWorkingDays < companyEmpWage.numOfWorkingDays) { totalWorkingDays++; Random random = new Random(); int empcheck = random.Next(0, 3); switch (empcheck) { case 1: empHrs = 8; break; case 2: empHrs = 4; break; default: empHrs = 0; break; } totalEmpHrs += empHrs; Console.WriteLine("Day : " + totalWorkingDays + " Emp Hrs: " + empHrs); } return(totalEmpHrs * companyEmpWage.empRatePerHr); }
public void addCompanyEmpWage(String companyName, int empRatePerHr, int numOfWorkingDays, int maxHrsPerMonth) { CompanyEmpWage companyEmpWage = new CompanyEmpWage(companyName, empRatePerHr, numOfWorkingDays, maxHrsPerMonth); this.companyEmpWageList.AddLast(companyEmpWage); this.companyToEmpWageMap.Add(companyName, companyEmpWage); }