public int computeEmpWage(CompanyEmpWage companyEmpWage) { int empHrs = 0; int totalWorkingDays = 0; int totalEmployeeHour = 0; while (totalEmployeeHour <= companyEmpWage.maxHoursPerMonth && totalWorkingDays <= companyEmpWage.numOfWorkingDays) { totalWorkingDays++; 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; } totalEmployeeHour += empHrs; Console.WriteLine("Day=" + totalWorkingDays + " Emplyee hours=" + empHrs); } companyEmpWage.dailyWage = empHrs * companyEmpWage.empRatePerHour; Console.WriteLine("Daily employee wages is = " + companyEmpWage.dailyWage); companyEmpWage.totalWageAlongWithDailyWage = totalEmployeeHour * companyEmpWage.empRatePerHour + companyEmpWage.dailyWage; Console.WriteLine("total wage along with daily wage = " + companyEmpWage.totalWageAlongWithDailyWage); return(totalEmployeeHour * companyEmpWage.empRatePerHour); }
public void addCompanyEmpWage(string company, int empRatePerHour, int numOfWorkingDays, int maxHoursPerMonth) { CompanyEmpWage companyEmpWage = new CompanyEmpWage(company, empRatePerHour, numOfWorkingDays, maxHoursPerMonth); this.companyEmpWageList.AddLast(companyEmpWage); this.companyToEmpWageMap.Add(company, companyEmpWage); }