Beispiel #1
0
        public void MyCode()
        {
            // The FIRST line of code should be BELOW this line

            //Worker FlemmingWorker = new Worker("Flemming");

            //Console.WriteLine($"{FlemmingWorker.GetName()}{FlemmingWorker.GetSalaryPerMonth()}");

            List <Employee> allemployess = new List <Employee>();

            Worker no1 = new Worker("Anne");
            Worker no2 = new Worker("Karen");

            allemployess.Add(no1);
            allemployess.Add(no2);

            JuniorManager Jun1 = new JuniorManager("Sofie", 30000, 5000);
            JuniorManager Jun2 = new JuniorManager("Rikke", 30000, 5000);

            Jun1.SetWorkingHours(160);
            Jun2.SetWorkingHours(200);
            allemployess.Add(Jun1);
            allemployess.Add(Jun2);

            SeniorManager sen1 = new SeniorManager("Lotte", 50000, 10000);
            SeniorManager sen2 = new SeniorManager("Jytte", 50000, 10000);

            sen1.SetPerformancelevel(4);
            sen2.SetPerformancelevel(7);
            allemployess.Add(sen1);
            allemployess.Add(sen2);

            foreach (Employee e in allemployess)
            {
                Console.WriteLine($"Navnet er: {e.GetName()} og lønnen er:{e.GetSalaryPerMonth()} med bonus: {e.IsBonusPaidOut()} ");
            }



            // The LAST line of code should be ABOVE this line
        }
Beispiel #2
0
        public void MyCode()
        {
            // The FIRST line of code should be BELOW this line

            List <Employee> allEmployees = new List <Employee>();

            Worker w1 = new Worker("Lars", 125, 150);
            Worker w2 = new Worker("Lone", 118, 120);
            Worker w3 = new Worker("Lasse", 95, 40);

            allEmployees.Add(w1);
            allEmployees.Add(w2);
            allEmployees.Add(w3);

            JuniorManager jm1 = new JuniorManager("Sigurd", 25000, 5000);

            jm1.SetWorkedHours(150);
            JuniorManager jm2 = new JuniorManager("Sigrid", 30000, 5000);

            jm2.SetWorkedHours(200);

            allEmployees.Add(jm1);
            allEmployees.Add(jm2);

            SeniorManager sm1 = new SeniorManager("Bent", 40000, 10000);

            sm1.SetPerformaceLevel(2);
            SeniorManager sm2 = new SeniorManager("Bente", 38000, 10000);

            sm2.SetPerformaceLevel(8);
            allEmployees.Add(sm1);
            allEmployees.Add(sm2);

            foreach (Employee e in allEmployees)
            {
                Console.WriteLine($"{e.GetName()} has a monthly salary of {e.GetSalaryPerMonth()}");
                Console.WriteLine();
            }

            // The LAST line of code should be ABOVE this line
        }
Beispiel #3
0
        public void MyCode()
        {
            // The FIRST line of code should be BELOW this line

            var worker01 = new Worker("Mike", 120, 38);

            Console.WriteLine($"Employee Name: {worker01.GetName()}");
            Console.WriteLine($"Salary: {worker01.GetSalaryPerMonth()}");
            Console.WriteLine($"Bonus paid: {worker01.IsBonusPaidOut()} \n");


            var jmanager01 = new JuniorManager("Small Boss", 1, 181, 5000);

            Console.WriteLine($"Junior Manager Name: {jmanager01.GetName()}");
            Console.WriteLine($"Junior Manager Salary: {jmanager01.GetSalaryPerMonth()}");
            Console.WriteLine($"Bonus Paid: {jmanager01.IsBonusPaidOut()} \n");


            var Smanager01 = new SeniorManager("Big Boss", 2, 180, 50000, 6);

            Console.WriteLine($"Senior Managers Name: {Smanager01.GetName()}");
            Console.WriteLine($"Senior Managers Salary: {Smanager01.GetSalaryPerMonth()}");
            Console.WriteLine($"Bonus Paid: {Smanager01.IsBonusPaidOut()} \n");

            ListofEmployees.Add(worker01);
            ListofEmployees.Add(jmanager01);
            ListofEmployees.Add(Smanager01);

            foreach (var item in ListofEmployees)
            {
                Console.WriteLine($"Name: {item.GetName()}");
                Console.WriteLine($"Salary: {item.GetSalaryPerMonth()}");
                Console.WriteLine($"Bonus Paid: {item.IsBonusPaidOut()} \n");
            }

            // The LAST line of code should be ABOVE this line
        }