Guest User

Untitled

a guest
Dec 11th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace CIS247_WK2_Lab_Dave_Hager
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. /*
  13. *********************************
  14. * Programming Week Lab 3 *
  15. * Employee lab *
  16. * Developer Dave Hager *
  17. * Date Completed 9/21/2012 *
  18. *********************************
  19. */
  20.  
  21. //Constructors
  22. Employee empData = new Employee();
  23. Employee empData2 = new Employee("Mary", "Noia", 'F', 5, 24000);
  24.  
  25.  
  26. Console.WriteLine("******** Enter Employee Data ********");
  27.  
  28. //Methods
  29. GetFirstName(empData);
  30. GetLastName(empData);
  31. Gender(empData);
  32. Dependants(empData);
  33. GetSalaryData();
  34. AnnualSalary(empData);
  35. Employee.GetNumberEmployees();
  36. empData.DisplayEmployee("Employee Information");
  37. empData2.DisplayEmployee("Employee Information");
  38. TerminateApplication();
  39. }
  40.  
  41. private static string GetFirstName(Employee empData)//Get First Name Method
  42. {
  43. string firstName = "";
  44. Console.Write("\nFirst name: ");
  45. firstName = Console.ReadLine();
  46. empData.FirstName = firstName;
  47. return firstName;
  48. }
  49.  
  50. private static string GetLastName(Employee empData)//Get Last Name Method
  51. {
  52. string lastName = "";
  53. Console.Write("\nLast name: ");
  54. lastName = Console.ReadLine();
  55. empData.LastName = lastName;
  56. return lastName;
  57. }
  58.  
  59. private static char Gender(Employee empData)//Get Gender Method
  60. {
  61. char gender;
  62. Console.Write("\nGender: ");
  63. gender = Convert.ToChar(Console.ReadLine());
  64. empData.Gender = gender;
  65. return gender;
  66. }
  67.  
  68. private static int Dependants(Employee empData)//Get Dependants Method
  69. {
  70. Console.Write("\nDependants: ");
  71. int dependants = Convert.ToInt32(Console.ReadLine());
  72. empData.Dependants = dependants;
  73. return dependants;
  74. }
  75.  
  76. public static void GetSalaryData()
  77. {
  78. string employeePay = string.Empty;
  79. Console.Write("\nSalary or Hourly? ");
  80. employeePay = Console.ReadLine();
  81. Console.WriteLine();
  82.  
  83. if (employeePay.ToLower() == "salary")
  84. {
  85.  
  86. }
  87.  
  88. else if (employeePay.ToLower() == "hourly")
  89. {
  90. Console.Write("Enter Hourly Rate: ");
  91. double hourlyRate = Convert.ToDouble(Console.ReadLine());
  92.  
  93. }
  94. }
  95. private static double AnnualSalary(Employee empData)//Get Annual Salary Method
  96. {
  97.  
  98. Console.Write("\nAnnual Salary: ");
  99. double salary = Convert.ToDouble(Console.ReadLine());
  100. empData.AnnualSalary = salary;
  101. return salary;
  102. }
  103.  
  104.  
  105.  
  106. private static void TerminateApplication()//Terminate Method
  107. {
  108. Console.WriteLine("\nHit Enter to Close Window");
  109. Console.ReadLine();
  110. }
  111.  
  112. }
  113. }
Add Comment
Please, Sign In to add comment