Example #1
0
        static void Main(string[] args)
        {
            Student student = new Student("Batman", "Batmanov", 5);


            Worker worker = new Worker("Darth", "Vader", 250M);

            Console.WriteLine("Money per hour");
            Console.WriteLine(worker.CalculateMoneyPerHour());

            List <Human> humans = new List <Human>();

            humans.Add(worker);
            humans.Add(student);
            foreach (var human in humans)
            {
                human.RepresentSelf();
            }
        }
Example #2
0
        public static ICollection <Worker> CreateWorkers(int count)
        {
            var workers = new List <Worker>();

            for (int i = 0; i < count; i++)
            {
                var name       = randomGenerator.RandomString(3, 10);
                var weekSalary = randomGenerator.RandomNumber(100, 300);
                var worker     = new Worker(name, name, weekSalary, WorkHoursPerDay);
                workers.Add(worker);
            }

            foreach (var worker in workers)
            {
                worker.CalculateMoneyPerHour(DaysPerWeek);
            }

            return(workers);
        }