Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Employee[] company = new Employee[]
            {
                new Menager("Bob", "Bobski"),
                new SalesPerson("John", "Dow"),
                new SalesPerson("Rick", "Brown")
            };

            Menager bob = (Menager)company[0];

            bob.AddBonus(5000);
            Console.WriteLine(bob.GetSalary());
            bob.PrintInfo();

            SalesPerson john = (SalesPerson)company[1];

            john.AddSuccessRevenue(5500);
            Console.WriteLine(john.GetSalary());
            john.GetSalary();
            john.PrintInfo();



            Console.ReadLine();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            //Exercise 1,2 and 3:
            Console.WriteLine("----------------------------------------------------------");
            Manager managerPerson = new Manager("William", "Damian", Manager.Role.Manager, 3500);

            managerPerson.AddBonus(500);
            managerPerson.GetSalary();
            managerPerson.PrintInfo();
            Console.WriteLine($"The manager:{managerPerson.FirstName}, has salary: {managerPerson.GetSalary()}$");

            Console.WriteLine("----------------------------------------------------------");
            SalesPerson salePerson = new SalesPerson("Jack", "Connor");

            salePerson.SetAddSuccessRevenue(2500);
            salePerson.GetSalary();
            salePerson.PrintInfo();
            Console.WriteLine($"Sale Person: {salePerson.FirstName}, has salary: {salePerson.GetSalary()}$ ");

            Console.WriteLine("----------------------------------------------------------");
            Employee employeePerson = new Employee();

            employeePerson.FirstName = "James";
            employeePerson.LastName  = "Reece";
            employeePerson.EmpRole   = Employee.Role.Other;
            employeePerson.SalaryEmp(400);
            employeePerson.PrintInfo();
            Console.WriteLine($"Other employee: {employeePerson.FirstName},has salary: {employeePerson.SalaryEmp(400)}$");


            Console.ReadLine();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            //Exercise 1
            //Create a class library project and in it create all classes
            //Create a class called Employee with the following properties:
            //    FirstName
            //    LastName
            //    Role - Enum {Sales, Manager, Other }
            //    Salary - protected, double
            //Create two methods:
            //    PrintInfo = Prints FirstName, LastName and Salary
            //    GetSalary - returns the salary


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

            Manager manager = new Manager("Marija", "Filipovska", 4500);

            manager.AddBonus(4000);

            Console.WriteLine($"The manager {manager.FirstName}, has salary: {manager.GetSalary()}$");


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

            SalesPerson salePerson = new SalesPerson("David", "Stojanovski");


            salePerson.GetSalary();

            salePerson.AddSuccessRevenue(2000);

            Console.WriteLine($"Sale Person {salePerson.FirstName}, has salary: {salePerson.GetSalary()}$ ");

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


            Employee employee = new Employee();

            employee.FirstName      = "John";
            employee.LastName       = "Doe";
            employee.RoleOfEmployee = Employee.Role.Other;
            var salaryOfEmployee = employee.GetSalaryOfEmployee(300);

            Console.WriteLine($"The salary of {employee.FirstName}, with role: {employee.RoleOfEmployee}, has salary: {salaryOfEmployee}$  ");
            // Without using method for setting Salary in class Employee, Salary = 0 because property Salary in class Employee is protected

            Console.ReadLine();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            Manager john = new Manager("John", "Brown");
            Manager bryn = new Manager("Bryn", "Ward");

            john.AddBonus(600);
            Console.WriteLine(john.GetSalary());
            Console.WriteLine("-----------------");
            SalesPerson mike = new SalesPerson("Mike", "Smith");

            mike.ExtendSuccessRevenue(1300);
            Console.WriteLine(mike.GetSalary());
            Console.WriteLine("-----------------");
            Contractor tim   = new Contractor("Tim", "Jones", 160, 2.5, john);
            Contractor brook = new Contractor("Brook", "Hanks", 160, 2.5, john);

            Console.WriteLine(tim.GetSalary());
            Console.WriteLine("-----------------");
            Employee[] company =
            {
                brook, tim, bryn, john, mike
            };
            CEO luke = new CEO("Luke", "Redd", company);

            luke.AddSharesPrice(5);
            Console.WriteLine($"{luke.Role}:");
            luke.PrintInfo();
            Console.WriteLine($"Salary of {luke.Role} is {luke.GetSalary()}");
            luke.PrintEmployees();
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Employee employee = new Employee()
            {
                FirstName = "Marko",
                LastName  = "Markovski",
                Role      = RoleEnum.Manager
            };

            Console.WriteLine(employee.GetInfo());

            SalesPerson salesPerson = new SalesPerson("Bill", "Madison");

            salesPerson.AddSuccessRevenue(400);
            Console.WriteLine(salesPerson.GetSalary());

            Manager manager = new Manager("Vilie", "Peterson", 1200);

            Console.WriteLine(manager.GetSalary());
            manager.AddBonus(200);
            manager.AddBonus(300);
            Console.WriteLine(manager.GetSalary());

            Console.ReadLine();
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            Employee employee = new Employee();

            employee.FirstName = "Aleksej";
            employee.Salary    = 10000;

            var employeeSalary = employee.GetSalary();

            SalesPerson salesPerson = new SalesPerson();

            salesPerson.AddSuccessRevenue(3000);

            var salesPersonSalary = salesPerson.GetSalary();

            Manager manager = new Manager("Aleksej", "Gjoshevski", Domain.Enums.Role.Manager, 14500);

            manager.Department = "IT";
            manager.AddBonus(5000);

            var menagerSalary = manager.GetSalary();

            Contractor contractor = new Contractor();

            contractor.PayPerHour  = 2500;
            contractor.WorkHours   = 8;
            contractor.Responsible = manager;

            var contractorSalary = contractor.GetSalary();
            var department       = contractor.CurrentPosition();
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            Employee employee = new Employee()
            {
                FirstName = "Bob",
                LastName  = "Bobsky",
                Role      = Role.Other
            };

            var employeeSalary = employee.GetSalary();

            SalesPerson salesPerson = new SalesPerson("Bill", "Billsky");

            salesPerson.AddSuccessRevenue(3500);

            var salesPersonSalary = salesPerson.GetSalary();

            Manager manager = new Manager("Elon", "Musk", 5000);

            manager.AddBonus(2000);

            var managerSalary = manager.GetSalary();

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Employee    employee      = new Employee("Bob", "Bobsky", Role.Other, 600);
            SalesPerson salesPerson   = new SalesPerson("Bill", "Billsky", 1500);
            Manager     manager       = new Manager("Elon", "Musk", 5000);
            Manager     managerTwo    = new Manager("Bil", "Gates", 5000);
            Contractor  contractor    = new Contractor("Steve", "Stevensky", 160, 15, manager);
            Contractor  contractorTwo = new Contractor("John", "Johnsky", 160, 30, manager);

            Employee[] company = { contractor, contractorTwo, manager, managerTwo, salesPerson };

            CEO RonCEO = new CEO("Ron", "Ronsky", company, 70, 20);

            RonCEO.PrintInfo();
            Console.WriteLine($"Salary of CEO is: {RonCEO.GetSalary()}");
            RonCEO.PrintEmployees();



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

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


            Console.WriteLine($" \n Employee salary: {employee.GetSalary()}");
            Console.WriteLine($"SalesPerson salary: {salesPerson.GetSalary()}");
            Console.WriteLine($"Manager salary: {manager.GetSalary()}");
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            Employee bob = new Employee()
            {
                FirstName = "Bob", LastName = "Bobski", Role = Role.Sales
            };
            //bob.PrintInfo();

            SalesPerson john = new SalesPerson("John", "Doe");

            john.PrintInfo();
            Console.WriteLine(john.GetSalary());
            john.AddSuccessRevenue(4000);
            Console.WriteLine(john.GetSalary());

            Console.ReadLine();
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            Manager     igor  = new Manager("Igor", "Mitkovski", "Finance", 7500);
            SalesPerson dejan = new SalesPerson("Dejan", "Ivkovski");

            //dejan.AddRevenue(2600);
            Console.WriteLine("{0:C}", dejan.GetSalary());
            dejan.PrintInfo();
            igor.AddBonus();
            igor.PrintInfo();
            Console.ReadLine();
        }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            // Employee emp = new Employee() { FirstName = "Bob", LastName = "Bobsky", Salary = 600, Role = Role.Other };
            SalesPerson sale = new SalesPerson("Bill", "Billsky", 1500);

            sale.ExtendSuccessSaleRevenue(2000);
            //emp.PrintInfo();
            sale.PrintInfo();
            //Console.WriteLine("Employee Salary: " + emp.GetSalary());
            Console.WriteLine("Sales Person Salary: " + sale.GetSalary());
            Console.ReadLine();
        }
Ejemplo n.º 12
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()}");
        }
Ejemplo n.º 13
0
        static void Main(string[] args)
        {
            Employee[] company = new Employee[]
            {
                new Contractor("Bob", "Bobert"),
                new Contractor("Rick", "Rickert"),
                new Manager("Mona", "Monalisa"),
                new Manager("Igor", "Igorsky"),
                new SalesPerson("Lea", "Leova"),
            };

            CEO ceoName = new CEO("Ron", "Ronsky", company);

            Console.WriteLine("CEO:");
            ceoName.PrintInfo();
            ceoName.AddSharesPrice(1400);
            var getSalary = ceoName.GetSalary();

            Console.WriteLine($"Salary of CEO is:{getSalary}");
            ceoName.PrintEmployees(company);


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

            Manager manager = new Manager("Bob", "Bobsky");

            manager.PrintInfo();
            var bonusF = manager.AddBonus(1500);

            Console.WriteLine($"The bonus is: {bonusF}");
            var mSalary = manager.GetSalary();

            Console.WriteLine($"The salary with bonus is: {mSalary}");

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

            SalesPerson salesPer = new SalesPerson("Radmila", "Sokolovska");

            salesPer.PrintInfo();
            Console.WriteLine(salesPer.GetSalary());

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

            Contractor contractor = new Contractor("Petre", "Petreski");

            contractor.PrintInfo();
            Console.Write("Salary is: ");
            Console.WriteLine(contractor.GetSalary());

            Console.ReadLine();
        }
Ejemplo n.º 14
0
        static void Main(string[] args)
        {
            SalesPerson salesPerson = new SalesPerson("John", "Doe", 1500);
            Manager     manager     = new Manager("Bob", "Bobsky", 2500);

            salesPerson.AddSuccessRevenue(2000);
            double salesPersonSalary = salesPerson.GetSalary();

            // Console.WriteLine(salesPersonSalary);

            manager.AddBonus(200);
            manager.AddBonus(5000);
            double managerSalary = manager.GetSalary();

            Console.WriteLine(managerSalary);
            Console.ReadLine();
        }
Ejemplo n.º 15
0
        static void Main(string[] args)
        {
            Employee emp = new Employee("Bob", "Bobsky");

            emp.Role = Role.Other;
            SalesPerson sale = new SalesPerson("Bill", "Billsky");

            emp.GetSalary(666);
            Manager manager = new Manager("Marija", "Prosheva", 300);

            sale.AddSuccessRevenue(2000);
            Console.WriteLine(emp.PrintInfo());
            Console.WriteLine(sale.PrintInfo());
            Console.WriteLine("Employee Salary: " + emp.GetSalary(666));
            Console.WriteLine("Sales Person Salary: " + sale.GetSalary(666));
            Console.WriteLine("Manager Salary :" + manager.GetSalary(444));
            Console.ReadLine();
        }
Ejemplo n.º 16
0
        static void Main(string[] args)
        {
            Manager manager = new Manager("Bob", "Bobsky");

            manager.PrintInfo();
            manager.AddBonus(3000);
            Console.WriteLine("Salary: {0}", manager.GetSalary());
            Console.WriteLine("------------------------------------");

            SalesPerson sales01 = new SalesPerson("John", "Snow");

            sales01.PrintInfo();
            sales01.ExtendSuccessSaleRevenue(1500);
            Console.WriteLine("Salary: {0}", sales01.GetSalary());


            Console.ReadLine();
        }
Ejemplo n.º 17
0
        static void Main(string[] args)
        {
            Manager manager = new Manager("Ivana", "Stefanovska");

            manager.PrintInfo();
            manager.AddBonus(3000);
            Console.WriteLine("Salary: {0}", manager.GetSalary());
            Console.WriteLine("------------------------------------");

            SalesPerson sales01 = new SalesPerson("Random1", "Random2");

            sales01.PrintInfo();
            sales01.AddSuccessSaleRevenue(1500);
            Console.WriteLine("Salary: {0}", sales01.GetSalary());


            Console.ReadLine();
        }
Ejemplo n.º 18
0
        static void Main(string[] args)
        {
            Employee    employee    = new Employee("Bob", "Bobsky", Role.Other, 600);
            SalesPerson salesPerson = new SalesPerson("Bill", "Billsky", 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($"SalesPerson salary: {salesPerson.GetSalary()}");
            Console.WriteLine($"Manager salary: {manager.GetSalary()}");
        }
Ejemplo n.º 19
0
        static void Main(string[] args)
        {
            Employee emp = new Employee()
            {
                FirstName = "Bob", LastName = "Bobsky", Salary = 600, Role = Role.Other
            };
            SalesPerson sale = new SalesPerson("Bill", "Billsky", 1500);
            Manager     mng  = new Manager("Ron", "Ronsky", 1500);

            sale.ExtendSuccessSaleRevenue(2000);
            mng.AddBonus(400);
            emp.PrintInfo();
            sale.PrintInfo();
            mng.PrintInfo();
            Console.WriteLine("Employee Salary: " + emp.GetSalary());
            Console.WriteLine("Sales Person Salary: " + sale.GetSalary());
            Console.WriteLine("Manager Salary: " + mng.GetSalary());
            Console.ReadLine();
        }
Ejemplo n.º 20
0
        static void Main(string[] args)
        {
            Manager     firstManager     = new Manager("Lea", "Leova", 1200);
            Manager     secondManager    = new Manager("John", "Johnsky", 1100);
            SalesPerson salesPerson      = new SalesPerson("Mona", "Monalisa");
            Contractor  firstContractor  = new Contractor("Bob ", "Bobert", 6.5, 450, firstManager);
            Contractor  secondContractor = new Contractor("Rick ", "Rickert", 5.5, 400, secondManager);

            firstContractor.GetSalary();
            secondContractor.GetSalary();

            firstManager.AddBonus();
            firstManager.GetSalary();

            secondManager.AddBonus();
            secondManager.GetSalary();

            salesPerson.AddSuccessRevenue(30000);
            salesPerson.GetSalary();

            Employee[] company = new Employee[]
            {
                firstManager,
                secondManager,
                salesPerson,
                firstContractor,
                secondContractor
            };

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

            double ceoSalary = empl.GetSalary();
            string infoCEO   = empl.PrintInfo();

            Console.WriteLine(infoCEO);
            Console.WriteLine($"Salary of CEO is: {empl.GetSalary()}");
            Console.WriteLine("Employees: ");
            empl.PrintEmployee();


            Console.ReadLine();
        }
Ejemplo n.º 21
0
        static void Main(string[] args)
        {
            ///---Task 01---

            Employee    employee    = new Employee("Bob", "Bobsky", Role.Other, 600);
            SalesPerson salesPerson = new SalesPerson("Bill", "Billsky", 1500);
            Manager     manager     = new Manager("Elon", "Musk", 5000);
            Contractor  contractor1 = new Contractor("Jeff", "Besos", 170, 11, manager);
            Contractor  contractor2 = new Contractor("Mark", "Raffalo", 155, 9, manager);



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

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



            Console.WriteLine($"{ contractor1.FirstName} - { contractor1.CurrentPosition("marketing")}");
            Console.WriteLine($"{ contractor2.FirstName} - { contractor2.CurrentPosition("IT")}");


            Console.WriteLine($"Employee salary: {employee.GetSalary()}");
            Console.WriteLine($"SalesPerson salary: {salesPerson.GetSalary()}");
            Console.WriteLine($"Manager salary: {manager.GetSalary()}");
            Console.WriteLine($"First Constructor is {contractor1.FirstName} and his/her salary is: {contractor1.GetSalary()}");
            Console.WriteLine($"Second Constructor is {contractor2.FirstName} and his/her salary is: {contractor2.GetSalary()}");

            ///--Task 02---



            Ceo ceo = new Ceo("Steve", "Jobs", 70, 340);

            Console.WriteLine($"{ceo.GetInfo()}");
            Console.Write($"The ceo has salary of: {ceo.GetSalary()} dolars.");
        }
Ejemplo n.º 22
0
        static void Main(string[] args)
        {
            Manager john = new Manager("John", "Doe");

            john.AddBonus(1000);
            john.GetSalary();
            Manager boki = new Manager("Boki", "Bobov");

            boki.AddBonus(1200);
            boki.GetSalary();
            Contractor koki = new Contractor("Koki", "Kokov", john, 40);

            koki.GetSalary();
            Contractor viki = new Contractor("Viki", "Vikova", boki, 50);

            viki.GetSalary();
            SalesPerson martin = new SalesPerson("Martin", "Martinov");

            martin.ExtendSuccessRevenue(3000);
            martin.GetSalary();

            Employee[] companyEmployees =
            {
                john,
                boki,
                koki,
                viki,
                martin
            };

            Ceo trump = new Ceo("Donald", "Trump", 7000, companyEmployees);

            trump.AddSharesPrice(100);
            trump.GetSalary();
            trump.PrintInfo();
            trump.PrintEmployees();



            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Manager     manager1     = new Manager("Kate", "Kateson");
            Manager     manager2     = new Manager("Bob", "Bobson");
            SalesPerson salesperson1 = new SalesPerson("John", "Smith");
            Contractor  contractor1  = new Contractor("Bill", "Billson", 5.5, 300, manager1);
            Contractor  contractor2  = new Contractor("Jill", "Jillson", 3.5, 400, manager2);

            contractor1.GetSalary();
            contractor2.GetSalary();
            manager1.AddBonus();
            manager2.AddBonus();
            manager1.GetSalary();
            manager2.GetSalary();
            salesperson1.AddSuccessRevenue(25000);
            salesperson1.GetSalary();

            Employee[] company =
            {
                manager1,
                manager2,
                salesperson1,
                contractor1,
                contractor2
            };

            CEO ceoNumber1 = new CEO("Frank", "Frink", 2313, company);

            double ceoSalary = ceoNumber1.GetSalary();
            string infoCEO   = ceoNumber1.PrintInfo();

            Console.WriteLine(infoCEO);
            Console.WriteLine("Employees: ");
            ceoNumber1.PrintEmployees();
            Console.ReadLine();
        }
Ejemplo n.º 24
0
        static void Main(string[] args)
        {
            SalesPerson simona = new SalesPerson("Simona", "Milanova", Role.Manager, 3000, 500);

            Console.WriteLine(simona.GetSalary());
        }