示例#1
0
        static void SalaryInput(Company company)
        {
            /* Input Variables */
            Employee e;
            String   input;
            String   iFirstName      = "";
            String   iLastName       = "";
            int      iEmployeeNumber = -1;
            double   iSalary         = -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 Salary: $");
            input   = Console.ReadLine();
            iSalary = int.Parse(input);
            e       = new SalaryEmployee(iFirstName, iLastName, iEmployeeNumber, iSalary);
            company.addEmployee(e);
        }
示例#2
0
        /*
         *  Add a random salary employee, takes a number of
         *  employees to add, as well as the company list
         */
        static void AddRandomSalary(int count, Company company)
        {
            Employee e;

            /* set some values for creating the employees */
            double salary = _r.Next(50000, 100000);
            int    empId  = _r.Next(100000, 999999);

            /* loop to add them */
            for (int i = 0; i < count; i++)
            {
                e = new SalaryEmployee("FN" + i, "LN" + i, empId, salary);
                company.addEmployee(e);
            }
        }
示例#3
0
 static void SalaryInput(Company company)
 {
     /* Input Variables */
     Employee e;
     String input;
     String iFirstName = "";
     String iLastName = "";
     int iEmployeeNumber = -1;
     double iSalary = -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 Salary: $");
     input = Console.ReadLine();
     iSalary = int.Parse(input);
     e = new SalaryEmployee(iFirstName, iLastName, iEmployeeNumber, iSalary);
     company.addEmployee(e);
 }
示例#4
0
        /* 
            Add a random salary employee, takes a number of 
            employees to add, as well as the company list 
        */
        static void AddRandomSalary(int count, Company company)
        {
            Employee e;

            /* set some values for creating the employees */
            double salary = _r.Next(50000,100000);
            int empId = _r.Next(100000,999999);

            /* loop to add them */
            for (int i = 0; i < count; i++)
            {
                e = new SalaryEmployee("FN" + i, "LN" + i, empId, salary);
                company.addEmployee(e);
            }
        }