Jenni Witzel

Jenni Witzel

  • NA
  • 27
  • 0

Home work help I have no idea what i am doing pls help 911

Oct 12 2008 12:27 AM
using System;
using SC = System.Console;
public class JKingLab6
{
    public static void Main()
    {
        string hoursWorkedStr, rateOfPayStr;
        double hoursWorked, rateOfPay;

        SC.WriteLine("Lab 6 – Jenni King\n");

        



        newEmployee.CalculateGrossPay();
        newEmployee.CalculateStateTax();
        newEmployee.CalculateFederalTax();
        newEmployee.CalculateFICATax();
        newEmployee.CalculateNetPay();

        SC.WriteLine("\nEnd of Lab 6\n");
    }
}


class Employee
{
    private double hoursWorked, rateOfPay, grossPay, stateTax,
                   federalTax, ficaTax, netPay;

    public Employee(double hrsWorked, double rate)  
    {
        hoursWorked = hrsWorked;
        rateOfPay = rate;
    }

    public void CalculateGrossPay()
    {
        grossPay = hoursWorked * rateOfPay;
        SC.WriteLine("\nGross pay is:\t{0,10}", grossPay.ToString("C"));
    }

    public void CalculateStateTax()
    {
        const double stateTaxRate = 0.04;
        stateTax = grossPay * stateTaxRate;

        SC.WriteLine("\nState tax is:\t{0,10}", stateTax.ToString("C"));
    }

    public void CalculateFederalTax()
    {
        const double federalTaxRate = 0.23;
        federalTax = grossPay * federalTaxRate;

        SC.WriteLine("\nFederal tax is:\t{0,10}", federalTax.ToString("C"));
    }

    public void CalculateFICATax()
    {
        const double ficaTaxRate = 0.14;
        ficaTax = grossPay * ficaTaxRate;

        SC.WriteLine("\nFICA tax is:\t{0,10}", ficaTax.ToString("C"));
    }

    public void CalculateNetPay()
    {
        netPay = grossPay - (stateTax + federalTax + ficaTax);
        SC.WriteLine("\nNet pay is:\t{0,10}", netPay.ToString("C"));
    }
}


Answers (1)