public static void DisplayEmployeeInformation(Employee theEmployee) { //this method will display theEmployee object to string method to the console //Create an Employee object using default constructor ApplicationUtilities.DisplayDivider(theEmployee.FirstName + " " + theEmployee.LastName); Console.WriteLine(theEmployee.ToString()); }
static void Main(string[] args) { Employee one = new Employee("Jamppa", "Camel jockey", 9000); Console.WriteLine(one.ToString()); Boss a = new Boss(); a.Name = "Anna"; a.Car = "Porsche"; a.Profession = "Camel caretaker"; a.Salary = 10000; a.Bonus = 5000; Console.WriteLine(a.ToString()); Boss b = new Boss("Pekka", "Camel farmer", 15000, "Ferrari", 5000); Console.WriteLine(b.ToString()); one.Profession = "Camel trainer"; one.Salary = 12000; Console.WriteLine(one.ToString()); }
static void Main(string[] args) { ApplicationUtilities.DisplayApplicationInformation(); //ApplicationUtilities.DisplayDivider("Please enter the emplyoyee information to be added"); string [] sampleEmployee = new string [10]; int count = 0; do { for (int samp = 0; samp < sampleEmployee.Length; samp++) { ApplicationUtilities.DisplayDivider("Please enter the emplyoyee information to be added"); Employee emp = new Employee(); emp.FirstName = InputUtilities.GetInput("First Name"); emp.LastName = InputUtilities.getStringInputValue("Last Name"); emp.Gender = InputUtilities.getCharInputValue("Gender"); emp.Dependents = InputUtilities.getIntegerInputValue("Number of dependents"); emp.AnnualSalary = InputUtilities.getDoubleInputValue("Annual Salary"); Console.WriteLine(emp.ToString()); emp.CalculateWeeklyPay(); Console.WriteLine("Weekly Pay: " + emp.CalculateWeeklyPay().ToString("C2")); count = samp++; Console.WriteLine("Number of employees: " + count++); } } while (count < 10); for (int samp = 0; samp < sampleEmployee.Length; samp++) { string newSamp = sampleEmployee[samp]; Console.Write(newSamp); } Console.WriteLine("\n*** There are " + Employee.NumEmployees + " Employee objects created***"); ApplicationUtilities.TerminateApplication(); }
//this method invokes the ToString and WriteToFile methods of the provided object public static void DisplayEmployeeInformation(Employee theEmployee) { Console.WriteLine("\n*************" + theEmployee.EmployeeName + "*************\n"); Console.WriteLine(theEmployee.ToString()); theEmployee.WriteToFile(); }
public static void DisplayEmployeeInformation(Employee theEmployee) { ApplicationUtilities.DisplayDivider(theEmployee.EmployeeType); Console.WriteLine(theEmployee.ToString()); }