Esempio n. 1
0
        static void HourlyInput(Company company)
        {
            /* Input Variables */
            Employee e;
            String   input;
            String   iFirstName      = "";
            String   iLastName       = "";
            int      iEmployeeNumber = -1;
            double   iDollarsPerHour = -1;
            double   iHours          = -1;

            /* TODO Error checking!! */
            Console.Write("Enter First Name: ");
            input      = Console.ReadLine();
            iFirstName = input;
            /* TODO Error checking!! */
            Console.Write("Enter Last Name: ");
            input     = Console.ReadLine();
            iLastName = input;
            /* TODO Error checking!! */
            Console.Write("Enter Employee Number: ");
            input           = Console.ReadLine();
            iEmployeeNumber = int.Parse(input);
            /* TODO Error checking!! */
            Console.Write("Enter Dollars Per Hour: $");
            input           = Console.ReadLine();
            iDollarsPerHour = double.Parse(input);
            /* TODO Error checking!! */
            Console.Write("Enter Number of Hours Worked: ");
            input  = Console.ReadLine();
            iHours = double.Parse(input);
            e      = new HourlyEmployee(iFirstName, iLastName, iEmployeeNumber, iDollarsPerHour, iHours);
            company.addEmployee(e);
        }
Esempio n. 2
0
        static void AddRandomHourly(int count, Company company)
        {
            Employee e;

            /* set some values for creating the employees */
            int    empNum       = 0;
            double hours        = 0;
            double moneyPerHour = 0;

            /* loop to add them */
            for (int i = 0; i < count; i++)
            {
                //empNum = _r.Next(100000, 999999);
                //moneyPerHour = _r.Next(8, 50);
                //hours = _r.Next(20, 40);
                /* create new employee */
                //e = new HourlyEmployee("FN" + i, "LN" + i, empNum, moneyPerHour, hours);
                e = new HourlyEmployee("FN" + i, "LN" + i, i, i, i);
                /* this adds employee to the company */
                company.addEmployee(e);
            }
        }
Esempio n. 3
0
        static void AddRandomHourly(int count, Company company)
        {
            Employee e;

            /* set some values for creating the employees */
            int empNum = 0;
            double hours = 0;
            double moneyPerHour = 0;

            /* loop to add them */
            for (int i = 0; i < count; i++)
            {

                //empNum = _r.Next(100000, 999999);
                //moneyPerHour = _r.Next(8, 50);
                //hours = _r.Next(20, 40);
                /* create new employee */
                //e = new HourlyEmployee("FN" + i, "LN" + i, empNum, moneyPerHour, hours);
                e = new HourlyEmployee("FN" + i, "LN" + i, i, i, i);
                /* this adds employee to the company */
                company.addEmployee(e);
            }
        }
Esempio n. 4
0
        static void HourlyInput(Company company)
        {
            /* Input Variables */
            Employee e;
            String input;
            String iFirstName = "";
            String iLastName = "";
            int iEmployeeNumber = -1;
            double iDollarsPerHour = -1;
            double iHours = -1;

            /* TODO Error checking!! */
            Console.Write("Enter First Name: ");
            input = Console.ReadLine();
            iFirstName = input;
            /* TODO Error checking!! */
            Console.Write("Enter Last Name: ");
            input = Console.ReadLine();
            iLastName = input;
            /* TODO Error checking!! */
            Console.Write("Enter Employee Number: ");
            input = Console.ReadLine();
            iEmployeeNumber = int.Parse(input);
            /* TODO Error checking!! */
            Console.Write("Enter Dollars Per Hour: $");
            input = Console.ReadLine();
            iDollarsPerHour = double.Parse(input);
            /* TODO Error checking!! */
            Console.Write("Enter Number of Hours Worked: ");
            input = Console.ReadLine();
            iHours = double.Parse(input);
            e = new HourlyEmployee(iFirstName, iLastName, iEmployeeNumber, iDollarsPerHour, iHours);
            company.addEmployee(e);
        }