Esempio n. 1
0
        public int ComputeEmpWage(ComputeWage companyEmpWage)
        {
            int totalEmpHours = 0;
            int workingDays   = 0;
            int empHours;
            int totalWagePerDay;
            int totalWagePerMonth = 0;

            while (totalEmpHours < companyEmpWage.maxHoursPerMonth && workingDays < companyEmpWage.numOfWorkingDays)
            {
                EmployeeWageComp empWageBuilder = new EmployeeWageComp();
                empHours = empWageBuilder.GetWorkingHours();

                if (totalEmpHours == 96)
                {
                    empHours = 4;
                }
                if (empHours != 0)
                {
                    workingDays++;
                    totalEmpHours      = empHours + totalEmpHours;
                    totalWagePerDay    = empHours * companyEmpWage.ratePerHours;
                    totalWagePerMonth += totalWagePerDay;
                    Console.WriteLine("Total Wage per Day.." + totalWagePerDay);
                }
            }
            return(totalWagePerMonth);
        }
Esempio n. 2
0
        public void AddCompanyEmpWage(string company, int empRatePerHour, int numOfWorkingDays, int maxHoursPerMonth)
        {
            ComputeWage companyEmpWage = new ComputeWage(company, empRatePerHour, numOfWorkingDays, maxHoursPerMonth);

            companyToEmpWageMap.Add(company, companyEmpWage);
            companyEmpWagesList.Add(companyEmpWage);
        }