Preview

xxxxxxxx

Satisfactory Essays
Open Document
Open Document
509 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
xxxxxxxx
Cis247C Lab5
// Program.cs (main program"
//CIS247C Lab5 using System; class Program
{
static void Main(string[] args)
{
Console.WriteLine("\nWelcome the Employee Hierarchy Program\n");
Console.WriteLine("\n CIS247 Week 5 Lab \n");
Console.WriteLine("\n Name: Solution \n ");
Console.WriteLine("\nThis program tests an Employee inheritance hierarchy\n");
Employee[] emp = new Employee[3]; emp[0] = new Employee("Joe", "Doe", 'M', 1, 10000.0, new Benefit("Partial", 1000, 2)); emp[1] = new Salaried("Zoe", "Likoudis", 'F', 3, 20000.0, new Benefit("Full", 2000, 4), 1); emp[2] = new Hourly("Kate", "Perry", 'F', 0, 75, 25, new Benefit("Partial", 3000, 8), "part time"); for (int i = 0; i < emp.Length; i++)
{
Console.WriteLine("\n***************** Display Employee's Data *****************\n");
Console.WriteLine(emp[i].ToString());
}
Console.WriteLine("\nTotal number of employees in Database: {0}\n", Employee.GetNumberOfEmployees());
}
} class Employee
{
protected string firstName; protected string lastName; protected char gender; protected int dependents; protected double annualSalary; private static int numEmployees = 0; protected Benefit benefit; public Employee()
{
firstName = "not given"; lastName = "not given"; gender = 'U'; dependents = 0; annualSalary = 20000; numEmployees++; benefit = new Benefit("not given", 0, 0);
}
public Employee(string first, string last, char gen, int dep, double salary, Benefit benefit)
{
firstName = first; lastName = last; gender = gen; dependents = dep; annualSalary = salary; numEmployees++; this.benefit = new Benefit(benefit.GetHealthInsurance(), benefit.GetLifeInsurance(), benefit.GetVacation());
}
public virtual double CalculatePay()
{
return annualSalary / 52;
}
public override string ToString()
{
return string.Format("Employee Type\t: {0}\nFirst Name\t: {1}\nLast Name\t: {2}\nGender\t\t: {3}\nDependents\t: {4}\nAnnual

You May Also Find These Documents Helpful

  • Good Essays

    Ac505 Project B

    • 901 Words
    • 4 Pages

    The company would hire three new employees. These three individuals would be full-time employees working 2,000 hours per year and earning $12.00 per hour. They would also receive the same benefits as other production employees, 18% of wages, in addition to $2,500 of health benefits.…

    • 901 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    BIS 219 Entire Course

    • 694 Words
    • 3 Pages

    Explain how you will structure and format your worksheet, including titles, column headings, and formulas to calculate payroll variables for each employee to determine "Net Pay" including and not limited to Total Hours, Gross Pay, Social Security Tax, Federal Withholding Tax, and Sate Withholding Tax. In addition, determine how you would extract overtime hours from a calculated value of "Total Hours" using a conditional formula.…

    • 694 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    CH 11 12 13 DIAGRAM

    • 351 Words
    • 2 Pages

    Use Table 10.2 above. If the wage for each worker is $20, how many workers will be utilized? 4…

    • 351 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    It210-Appendix G

    • 436 Words
    • 2 Pages

    Write “The purpose of this program is to calculate tax for a given salary range”…

    • 436 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    PRG/420 Week 3

    • 1025 Words
    • 5 Pages

    Scanner; /* * @author * Week 3 Individual Assignment * Assignment: Simple Commission Calculation Project Part 2 * Due Date: */ public class AnnualCompensationCalculator { /** * main method begins program execution */ public static void main(String args[]) { String firstName; // Get user 's first name String lastName; // Get user 's last name int salary; // User 's fixed annual salary double commissionRate; // User 's commission rate double sales; // User 's annual sales double totalCommission; // User 's total commission earned double totalCompensation; //…

    • 1025 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    EmpID) weeklyhours1 on weeklyhours1.empid = Employees. EmpID and weeklyhours1.week1 >…

    • 485 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Salem

    • 923 Words
    • 4 Pages

    82,000 =$400/hour * 205 hours 110,400 =$800/hour * 138 hours 192,400 9,844 =$28.70 * (205 hours + 138 hours) 182,556 8,000…

    • 923 Words
    • 4 Pages
    Powerful Essays
  • Good Essays

    Programing Problems

    • 721 Words
    • 3 Pages

    RegularHours * HourlyRate + OvertimeHours * (HourlyRate * 1.5) End Gross Pay module Tax Module Tax=GrossPay*.30 End Tax Module Net Pay Module NetPay = GrossPay –Tax – Parking…

    • 721 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Unit 3 Ip Econ 220

    • 697 Words
    • 3 Pages

    Total Variable Cost = (Number of Workers * Worker’s Daily Wage) + Other Variable Costs…

    • 697 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    what ever

    • 1175 Words
    • 5 Pages

    Three employee initials; the number of hours worked; the hourly rate of pay for the employee. Calculate and output the employee's gross pay, deductions, and net pay. Deductions include the following:…

    • 1175 Words
    • 5 Pages
    Powerful Essays
  • Better Essays

    The accountant proposes a division into machine hour and direct labor burden. According to Exhibit 5, the new burden rate is 21% and the machine hour rate is $80,10.…

    • 1287 Words
    • 6 Pages
    Better Essays
  • Satisfactory Essays

    Resource Name |Type |Initials |Group |Max. Units |Std. Rate |Ovt. Rate |Cost/Use |Accrue At |Base Calendar |Over allocated | |Marketing Specialist |Work |MS |Marketing |400% |$60.00/hr |$0.00/hr |$0.00 |Prorated |Calendar 2 |No | |Design Engineer |Work |DesE |Design |400% |$90.00/hr |$0.00/hr |$0.00 |Prorated |Calendar 2 |Yes | |Development engineer |Work |DevE |Development |400% |$80.00/hr |$0.00/hr |$0.00 |Prorated |Calendar 2 |No | |Industrial engineer |Work |IE |Industrial |400% |$70.00/hr |$0.00/hr |$0.00 |Prorated |Calendar 2 |Yes | |Purchasing agent |Work |PA |Purchasing |100% |$50.00/hr…

    • 491 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    BIS 155 Final

    • 2158 Words
    • 9 Pages

    Explain how you will structure and format your worksheet, including titles, column headings, and formulas to calculate payroll variables for each employee to determine "Net Pay" including and not limited to Total Hours, Gross Pay, Social Security Tax, Federal Withholding Tax, and Sate Withholding Tax. In addition, determine how you would extract overtime hours from a calculated value of "Total Hours" using a conditional formula.…

    • 2158 Words
    • 9 Pages
    Good Essays
  • Good Essays

    Assignment 4

    • 517 Words
    • 4 Pages

    e. The opportunity cost of Juan's time is $8 per hour. If Juan receives $2 per…

    • 517 Words
    • 4 Pages
    Good Essays
  • Good Essays

    This example uses the length property of the String object to find the length of a string:…

    • 732 Words
    • 3 Pages
    Good Essays

Related Topics