private int computeEmpWage(CompanyEmpWage companyEmpWage)
        {
            //variables
            int empHrs = 0, totalEmpHrs = 0, totalWorkingDays = 0;

            //computation
            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 + " Emp Hrs : " + empHrs);
            }
            return(totalEmpHrs * companyEmpWage.empRatePerHour);
        }
Exemple #2
0
        private int computeEmpWage(CompanyEmpWage companyEmpWage)
        {
            int empHrs = 0, totalEmpHrs = 0, totalWorkingDays = 0;

            while (totalEmpHrs <= companyEmpWage.maxHoursPerMonth && totalWorkingDays < companyEmpWage.numOfWorkingDays)
            {
                totalWorkingDays++;
                Random random = new Random();
                int    check  = random.Next(1, 4);
                switch (check)
                {
                case 2:
                    empHrs = 8;
                    break;

                case 1:
                    empHrs = 4;
                    break;

                default:
                    empHrs = 0;
                    break;
                }
                totalEmpHrs += empHrs;
                Console.WriteLine("Days#:" + totalWorkingDays + " Emp Hrs :" + empHrs);
            }
            return(totalEmpHrs * companyEmpWage.empRatePerHour);
        }
        public void addCompanyEmpWage(string company, int empRatePerHour, int numOfWorkingDays, int maxHoursPerMnth)
        {
            CompanyEmpWage companyEmpWage = new CompanyEmpWage(company, empRatePerHour, numOfWorkingDays, maxHoursPerMnth);

            this.companyEmpWagesList.AddLast(companyEmpWage);
            this.companyToEmpWageMap.Add(company, companyEmpWage);
        }
Exemple #4
0
        public int computeEmpWage(CompanyEmpWage companyEmpWage)
        {
            int empHrs           = 0;
            int totalEmpHrs      = 0;
            int totalWorkingDays = 0;

            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("Day:" + totalWorkingDays + " Emp hrs " + empHrs + "  Daily Wage:" + (empHrs * companyEmpWage.empRatePerHour));
            }
            return(totalEmpHrs * companyEmpWage.empRatePerHour);
        }
        private int ComputeWage(CompanyEmpWage CompanyEmpWage)
        {
            int Wage = 0, TotalHrs = 0, TotalDay = 0;

            while (TotalHrs <= CompanyEmpWage.WorkHrs && TotalDay < CompanyEmpWage.WorkDay)
            {
                TotalDay++;
                Random Number = new Random();
                int    Num    = Number.Next(0, 3);
                switch (Num)
                {
                case FullTime:
                    Wage = 8;
                    break;

                case PartTime:
                    Wage = 4;
                    break;

                default:
                    Wage = 0;
                    break;
                }
                TotalHrs += Wage;
                Console.WriteLine("Day:  " + TotalDay + "  Emp Hrs: " + Wage);
            }
            CompanyEmpWage.DailyWage = Wage * CompanyEmpWage.WagePerHour;
            CompanyEmpWage.TotalWageWithDailyWage = Wage * CompanyEmpWage.WagePerHour + CompanyEmpWage.DailyWage;

            return(TotalHrs * CompanyEmpWage.WagePerHour);
        }
        public void AddCompanyWage(string Company, int WagePerHour, int WorkDay, int WorkHrs)
        {
            CompanyEmpWage CompanyEmpWage = new CompanyEmpWage(Company, WagePerHour, WorkDay, WorkHrs);

            this.CompanyWageList.AddLast(CompanyEmpWage);
            this.CompanytoEmpWageMap.Add(Company, CompanyEmpWage);
        }
        public void AddCompany()
        {
            Company company = new Company();
            company.CompanyWageProfile();
            CompanyEmpWage companyEmpWage = new CompanyEmpWage(company);

            allCompanyWages.AddLast(companyEmpWage);
        }
 public void AddCompany(Company company)
 {
     CompanyEmpWage companyEmpWage = new CompanyEmpWage(company);
     allCompanyWages.AddLast(companyEmpWage);
 }