static void Main(string[] args) { //new object of class Mitarbeiter a = new Mitarbeiter(1800, "Hans"); try { //printing properties of objects Console.WriteLine(a.GetName()); Console.WriteLine(a.GetGehalt()); //calling method and printing effects a.ShowGehalt(a.GetGehalt()); Console.WriteLine(a.GetGehalt()); } catch (Exception e) { Console.WriteLine(e.Message); } }
static void Main(string[] args) { Mitarbeiter m1 = new Mitarbeiter("David", "Boisits", 1234); Mitarbeiter m2 = new Mitarbeiter("Markus", "Diewald", 2345); Mitarbeiter m3 = new Mitarbeiter("Peter", "Huber", 4734); //Mitarbeiter ausgeben Console.WriteLine("Vorname: " + m1.Vorname + " " + "Nachname: " + m1.Nachname + " " + "SVN: " + m1.SVN); Console.WriteLine("Vorname: " + m2.Vorname + " " + "Nachname: " + m2.Nachname + " " + "SVN: " + m2.SVN); Console.WriteLine("Vorname: " + m3.Vorname + " " + "Nachname: " + m3.Nachname + " " + "SVN: " + m3.SVN); Console.WriteLine(); Console.WriteLine("Aendere die Nachnamen!"); Console.WriteLine(); m1.changelastname("Boisitsneu"); m2.changelastname("Diewaldneu"); m3.changelastname("Huberneu"); Console.WriteLine("Vorname: " + m1.Vorname + " " + "Nachname: " + m1.Nachname + " " + "SVN: " + m1.SVN); Console.WriteLine("Vorname: " + m2.Vorname + " " + "Nachname: " + m2.Nachname + " " + "SVN: " + m2.SVN); Console.WriteLine("Vorname: " + m3.Vorname + " " + "Nachname: " + m3.Nachname + " " + "SVN: " + m3.SVN); }