/* Description: As in lab 6, this program prompts for */
/* and accepts information about an */
/* hourly employee and calculates wages */
/* and taxes using a class named */
/* Employee. This lab will also prompt */
/* for the employee's name, calculate */
/* overtime pay and loop to allow */
/* multiple employees. */
/* */
/********************************************************/
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")
} // 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()
public void CalculateFICATax()
public void CalculateNetPay()
} // end of Employee class