Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace CIS247_WK2_Lab_Dave_Hager
- {
- class Program
- {
- static void Main(string[] args)
- {
- /*
- *********************************
- * Programming Week Lab 3 *
- * Employee lab *
- * Developer Dave Hager *
- * Date Completed 9/21/2012 *
- *********************************
- */
- //Constructors
- Employee empData = new Employee();
- Employee empData2 = new Employee("Mary", "Noia", 'F', 5, 24000);
- Console.WriteLine("******** Enter Employee Data ********");
- //Methods
- GetFirstName(empData);
- GetLastName(empData);
- Gender(empData);
- Dependants(empData);
- GetSalaryData();
- AnnualSalary(empData);
- Employee.GetNumberEmployees();
- empData.DisplayEmployee("Employee Information");
- empData2.DisplayEmployee("Employee Information");
- TerminateApplication();
- }
- private static string GetFirstName(Employee empData)//Get First Name Method
- {
- string firstName = "";
- Console.Write("\nFirst name: ");
- firstName = Console.ReadLine();
- empData.FirstName = firstName;
- return firstName;
- }
- private static string GetLastName(Employee empData)//Get Last Name Method
- {
- string lastName = "";
- Console.Write("\nLast name: ");
- lastName = Console.ReadLine();
- empData.LastName = lastName;
- return lastName;
- }
- private static char Gender(Employee empData)//Get Gender Method
- {
- char gender;
- Console.Write("\nGender: ");
- gender = Convert.ToChar(Console.ReadLine());
- empData.Gender = gender;
- return gender;
- }
- private static int Dependants(Employee empData)//Get Dependants Method
- {
- Console.Write("\nDependants: ");
- int dependants = Convert.ToInt32(Console.ReadLine());
- empData.Dependants = dependants;
- return dependants;
- }
- public static void GetSalaryData()
- {
- string employeePay = string.Empty;
- Console.Write("\nSalary or Hourly? ");
- employeePay = Console.ReadLine();
- Console.WriteLine();
- if (employeePay.ToLower() == "salary")
- {
- }
- else if (employeePay.ToLower() == "hourly")
- {
- Console.Write("Enter Hourly Rate: ");
- double hourlyRate = Convert.ToDouble(Console.ReadLine());
- }
- }
- private static double AnnualSalary(Employee empData)//Get Annual Salary Method
- {
- Console.Write("\nAnnual Salary: ");
- double salary = Convert.ToDouble(Console.ReadLine());
- empData.AnnualSalary = salary;
- return salary;
- }
- private static void TerminateApplication()//Terminate Method
- {
- Console.WriteLine("\nHit Enter to Close Window");
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment