예제 #1
0
        public void AddCompanyEmpWage(string company, int empRatePerHour, int numOfWorkingDays, int maxHourPerMonth)
        {//body of interface member
            CompanyEmpWage companyEmpWage = new CompanyEmpWage(company, empRatePerHour, numOfWorkingDays, maxHourPerMonth);
            this.companyEmpWageList.AddLast(companyEmpWage);
            this.companyToEmpWageMap.Add(company, companyEmpWage);

        }
예제 #2
0
 public int computeEmpWage(CompanyEmpWage companyEmpWage)
 {
     int empHrs = 0, totalEmpHrs = 0, totalWorkingDays = 0; //variables
     while (totalEmpHrs <= 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;
         }
         totalEmpHrs += empHrs;
         Console.WriteLine("Days" + totalWorkingDays + "EmpHrs : " + empHrs);
     }
     companyEmpWage.dailyWage = empHrs * companyEmpWage.empRatePerHour;
     companyEmpWage.TotalWageAlongWithDailyWage = totalEmpHrs * companyEmpWage.empRatePerHour + companyEmpWage.dailyWage;
     return totalEmpHrs * companyEmpWage.empRatePerHour;
 }
        public void AddCompanyEmpWage(string company, int empRatePerHour, int numOfWorkingDays, int maxHourPerMonth)
        {//body of interface member
            companyEmpWageArray[this.numOfCompany] = new CompanyEmpWage(company, empRatePerHour, numOfWorkingDays, maxHourPerMonth);
            CompanyEmpWage companyEmpWage = new CompanyEmpWage(company, empRatePerHour, numOfWorkingDays, maxHourPerMonth);

            companyToEmpWageMap.Add(company, companyEmpWage);
            numOfCompany++;
        }