private static void Main(string[] args) { Console.WriteLine("Template Method Mode Demo"); var manager = new Manager(); manager.GetSalary(); var ceo = new Ceo(); ceo.GetSalary(); }
static void Main(string[] args) { Manager Bob = new Manager("Bob", "Bobsky", 2542); Manager John = new Manager("John", "Jonissimo", 5000); Contractor Mona = new Contractor("Mona", "Monalisa", 80, 120, Bob); Contractor Igor = new Contractor("Igor", "Igorski", 85, 100, John); SalesPerson Lea = new SalesPerson("Lea", "Leova", 87); Employee[] company = { Bob, John, Mona, Igor, Lea }; Ceo Ron = new Ceo("Ron", "Ronsky", company, 1500); Ron.AddSharesPrice(103); Console.WriteLine("Info " + Ron.GetInfo()); Console.WriteLine("Salary " + Ron.GetSalary()); Ron.GetEmployees(); }
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."); }
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(); }