public void addComapnyEmpWage(string company, int empRatePerHour, int numOfWorkingDays, int maxHoursPerMonth) { EmployeeWageComputationProblem companyEmpWage = new EmployeeWageComputationProblem(company, empRatePerHour, numOfWorkingDays, maxHoursPerMonth); this.companyEmpWageList.AddLast(companyEmpWage); this.companyToEmpWageMap.Add(company, companyEmpWage); }
private int ComputeEmployeeWage(EmployeeWageComputationProblem companyEmpWage) { int emphrs = 0; int empWage = 0; int totalempwage = 0; int hrs = 0; int workingDays = 1; while (emphrs <= companyEmpWage.maxHoursPerMonth && workingDays < companyEmpWage.numOfWorkingDays) { workingDays++; Random random = new Random(); int EmpCheack = random.Next(0, 3); //Random Generate 0 ,1,2 switch (EmpCheack) //Switch case Statment { case FULL_TIME: //Employee is FullTime=1 emphrs = 8; break; case PART_TIME: //Employee is FullTime=2 emphrs = 4; break; default: emphrs = 0; break; } hrs += emphrs; Console.WriteLine("Day " + workingDays + " Emp hrs:- " + emphrs); //totalempwage = totalempwage + empWage; //Calculate total employe month wage //empWage = empRatePerHour * emphrs; } return(emphrs * companyEmpWage.empRatePerHour); }