public int ComputeEmpWage(CompanyEmpWag companyEmp) { // All Local. int empHrs; int totalNumOfHrs = 0; int totalNumOfDay = 0; // Check for condition. while (totalNumOfHrs <= companyEmp.maxHourPerMonth && totalNumOfDay < companyEmp.numOfWorkingDay) { totalNumOfDay++; Random random = new Random(); int empCheck = random.Next(0, 3); switch (empCheck) { case IS_PART_TIME: empHrs = 4; break; case IS_FULL_TIME: empHrs = 8; break; default: empHrs = 0; break; } totalNumOfHrs += empHrs; } return(totalNumOfHrs * companyEmp.empRatePerHour); }
public void AddCompanyEmpWage(string company, int empRatePerHour, int numOfWorkingDay, int maxHourPerMonth) { CompanyEmpWag empWag = new CompanyEmpWag(company, empRatePerHour, numOfWorkingDay, maxHourPerMonth); list.AddLast(empWag); keyValues.Add(company, empWag); }