Пример #1
0
        static void Main(string[] args)
        {
            Manager    bob  = new Manager("Bob", "Bobert", "Development department", 1200);
            Manager    rick = new Manager("Rick", "Rickert", "HR department", 1300);
            Contratcor mona = new Contratcor("Mona", "Monalisa", 20.5, 70, bob);
            Contratcor igor = new Contratcor("Igor", "Igorsky", 12.2, 80, rick);
            Sales      lea  = new Sales("Lea", "Leova");

            lea.AddSuccessRevenue(1800);

            Employee[] employees = new Employee[] { bob, rick, mona, igor, lea };

            Console.WriteLine($"{mona.GetInfo()} - salary: {mona.Salary}$ - department: {mona.CurrentPossition()}");

            Console.WriteLine("----------------");

            CEO ceo = new CEO("Ron", "Ronsky", employees, 1500, 140);

            ceo.AddSharesPrice(10);
            Console.WriteLine($"{ceo.GetInfo()} - salary: {ceo.Salary}");
            Console.WriteLine($"Salary of CEO is: {ceo.GetSalary()}");
            Console.WriteLine("Employees:");
            ceo.PrintEmployees();
            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Employee emp = new Employee()
            {
                FirstName = "Marko", LastName = "Naumov", Role = Role.Other
            };
            SalesPerson sp   = new SalesPerson("Bojan", "Sazdovski");
            Manager     mg   = new Manager("Damjan", "Temelko", 500);
            Employee    emp2 = new Employee()
            {
                FirstName = "Petko", LastName = "petkovski", Role = Role.Other
            };
            Employee emp3 = new Employee()
            {
                FirstName = "Stanko", LastName = "stankovski", Role = Role.Other
            };
            Contractor cont  = new Contractor("Ivan", "Ivanovski");
            Contractor cont2 = new Contractor("Stojan", "Stojanovski");
            Manager    mg2   = new Manager("Elena", "Stojanovska", 400);

            Employee[] company = { sp, mg, mg2, cont, cont2 };

            CEO ceo = new CEO("Steve", "Jobs", 500, company, 120);

            ceo.AddSharePrice(200);


            ceo.GetInfo();
            Console.WriteLine($"The salary of CEO is {ceo.GetSalary()}");
            ceo.PrintEmployees();
            Console.ReadLine();
        }
Пример #3
0
        static void Main(string[] args)
        {
            Employee    employee    = new Employee("Bob", "Bobsky", Role.Others, 600);
            SalesPerson salesPerson = new SalesPerson("Bill", "Bilsky", 1500);
            Manager     manager     = new Manager("Elon", "Musk", 5000);

            salesPerson.ExtendSuccessRevenue(2000);
            manager.AddBonus(4000);
            salesPerson.ExtendSuccessRevenue(3000);

            Console.WriteLine(employee.GetInfo());
            Console.WriteLine(salesPerson.GetInfo());
            Console.WriteLine(manager.GetInfo());

            Console.WriteLine($"Employee salary: {employee.GetSalary()}");
            Console.WriteLine($"Sales person salary: {salesPerson.GetSalary()}");
            Console.WriteLine($"Manager salary: {manager.GetSalary()}");


            Contractor contractor = new Contractor("Greg", "Gregsky", 40, 50, manager);

            Console.WriteLine($"Contractor current manager: {contractor.CurrentManager()}");
            Console.WriteLine($"Manager salary: {contractor.GetSalary()}");



            Employee[] company = new Employee[5]
            {
                new Contractor("Bill", "Bilsky", 38, 55, manager),
                new Contractor("Mallory", "Monroe", 44, 60, manager),
                new Manager("Scot", "Scotsky", 1000),
                new Manager("Ben", "Bensky", 2000),
                new SalesPerson("Jill", "Jillsky", 1500)
            };

            CEO ceo = new CEO("Ron", "Ronsky", 1500, company);

            Console.WriteLine($"\n\nCEO: {ceo.GetInfo()}");
            Console.WriteLine("Employees: ");
            foreach (string employee1 in ceo.GetEmployees())
            {
                Console.WriteLine(employee1);
            }

            Console.WriteLine(ceo.GetSalary());

            ceo.SetShares(30);
            ceo.AddSharesPrice(500);

            Console.WriteLine($"CEO sallary with shares: {ceo.GetSalary()}");
        }