Jenni Witzel

Jenni Witzel

  • NA
  • 27
  • 0

Pls help Program 'program' does not contain a static 'Main' method suitable for an entry point ?

Oct 17 2008 12:25 PM
On both my labs i get the same responds i dont think my coding is correct can u pls fix it thx

using System;
using SC = System.Console;
public class FLastLab07
{ //Main Method
public static void Main()
{
string eName, hoursWorkedStr, rateOfPayStr;
double hoursWorked, rateOfPay;

SC.WriteLine("Lab 7 – Your Name");
SC.Write("\nPlease input Employee Name: ");
employeeName = SC.ReadLine();

while (employeeName != "Quit")
{






SC.Write("\nPlease input Employee Name: ");
employeeName = SC.ReadLine();
} // end of loop

SC.WriteLine("\nEnd of Lab 7\n");
} // end of Main method
} // end of Main class


class Employee
{
private string employeeName;

private double hoursWorked, rateOfPay, grossPay, stateTax,
federalTax, ficaTax, netPay;

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

public void PrintName()
{
SC.WriteLine("\nEmployee Name:\t{0}", employeeName);
}

public void CalculateGrossPay()
{
if (hoursWorked > 40)
. . .
else
. . .

SC.WriteLine("Gross pay is:\t{0,10}", grossPay.ToString("C"));
}

public void CalculateStateTax()
{
// same
}

public void CalculateFederalTax()
{
// same
}

public void CalculateFICATax()
{
// same
}

public void CalculateNetPay()
{
// same
}
} // end of Employee class





using System;
public class JKingLab6
{
public static void Main()
{


SC.WriteLine("Lab 6 – Jenni King\n");
Employee newEmployee = new Employee(hours, rate);

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

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


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 (2)