Question: Please Help me fulfill requirement in C# all files that are need to complete the requirements are attach also All files needed are attached also
Please Help me fulfill requirement in C# all files that are need to complete the requirements are attach also
All files needed are attached
also take a look at expected output

---------------------------------------------
/* Purpose: Process payroll report using parallel arrays. */
//Program 1.cs
using System; using System.IO; using System.Text.RegularExpressions; using LibUtil;
// The application class class Ch7Prb1 {
const double FICA_RATE = 0.07; const double FED_TAX_RATE = 0.22; const double STATE_TAX_RATE = 0.05; const string INPUT_FILE_NAME = "...\\...\\PayrollDat.Txt"; const string OUTPUT_FILE_NAME = "...\\...\\PayrollReport.Txt";
static uint numOfEmployees; static string[] lastNameArray = new string[51], firstNameArray = new string[51]; static uint[] deptArray = new uint[51]; static double[] rateArray = new double[51], hoursArray = new double[51]; static double[] earningsArray = new double[51], ficaArray = new double[51]; static double[] fedTaxArray = new double[51], stateTaxArray = new double[51]; static double[] netPayArray = new double[51]; static StreamReader fileIn; static StreamWriter fileOut;
static void Main() { OpenFiles(); InputData(); CalcDetailPayroll(); PrintReport(); CloseFiles(); }
static void OpenFiles() { if (File.Exists(INPUT_FILE_NAME)) { fileIn = File.OpenText(INPUT_FILE_NAME); Console.WriteLine("{0} was opened",INPUT_FILE_NAME); } else { Console.WriteLine("Error: {0} does not exist ",INPUT_FILE_NAME); ConsoleApp.Exit(); } fileOut = File.CreateText(OUTPUT_FILE_NAME); if (File.Exists(OUTPUT_FILE_NAME)) Console.WriteLine("{0} was created ",OUTPUT_FILE_NAME); else { Console.WriteLine("Error: {0} could not be created ",OUTPUT_FILE_NAME); ConsoleApp.Exit(); } }
static void ParseLineIn(string lineIn, uint i) { string[] words = new string[5];
lineIn = lineIn.Trim(); while (Regex.IsMatch(lineIn,"[ ]{2}")) lineIn = lineIn.Replace(" "," "); words = lineIn.Split(' '); lastNameArray[i] = words[0]; //Add code to read in data into remaining arrays }
static void InputData() { uint i; string lineIn;
i = 0; while ((lineIn=fileIn.ReadLine())!=null) { i++; ParseLineIn(lineIn,i); } numOfEmployees = i; }
static void CalcDetailPayroll() { uint i; double basePay,ovtPay;
for (i=1; i
static double Total(double[] doubleArray) { }
static double Mean(double[] doubleArray) { uint i; double sum=0.0;
for (i=1; i
static double Max(double[] doubleArray) { uint i; double max;
max = doubleArray[1]; for (i=2; imax) max = doubleArray[i]; return max; }
static double Min(double[] doubleArray) { }
static void PrintReport() { uint i;
fileOut.WriteLine(" Payroll Report "); fileOut.WriteLine(); fileOut.WriteLine(" Last Name First Name Dept Rate Hours Earnings FICA Fed Tax State Tax Net Pay "); fileOut.WriteLine("--------------- --------------- ---- ----- ----- --------- --------- --------- --------- ---------"); //Create for loop to display last name, firstname, dept, rate, hours, earnings fica, fedTax, stateTax, and netPay fileOut.WriteLine(" --------- --------- --------- --------- ---------"); fileOut.WriteLine("{0,-49}{1,9:n} {2,9:n} {3,9:n} {4,9:n} {5,9:n}", "Total",Total(earningsArray),Total(ficaArray), Total(fedTaxArray),Total(stateTaxArray),Total(netPayArray)); fileOut.WriteLine("{0,-49}{1,9:n} {2,9:n} {3,9:n} {4,9:n} {5,9:n}", "Mean",Mean(earningsArray),Mean(ficaArray), Mean(fedTaxArray),Mean(stateTaxArray),Mean(netPayArray)); fileOut.WriteLine("{0,-49}{1,9:n} {2,9:n} {3,9:n} {4,9:n} {5,9:n}", "Maximum",Max(earningsArray),Max(ficaArray), Max(fedTaxArray),Max(stateTaxArray),Max(netPayArray)); fileOut.WriteLine("{0,-49}{1,9:n} {2,9:n} {3,9:n} {4,9:n} {5,9:n}", "Minimum",Min(earningsArray),Min(ficaArray), Min(fedTaxArray),Min(stateTaxArray),Min(netPayArray)); }
static void CloseFiles() { fileIn.Close(); fileOut.Close(); }
} ----------------------------------------------------------------
//PayrollDat.Txt
Adams Paul 3 9.75 40.00 Allen Cindy 2 11.45 48.00 Allen Sarah 4 10.30 40.00 Baker John 1 22.00 43.25 Baker Toni 1 12.65 40.00 Baldwin Cindy 2 7.90 25.50 Carson Robert 1 8.35 52.50 Freeman Sally 4 15.25 40.00 Garfield James 3 22.00 40.00 Grimes Kerri 3 16.50 35.00 Harris Joan 2 18.65 51.00 Harris John 2 9.00 47.50 Lawson LeAnn 4 17.85 40.00 Mason Debbie 4 22.00 41.50 Masters Kenneth 3 16.10 40.25 Patterson Roseanne 2 13.70 38.00 Peterson Paul 2 22.00 44.00 Randall Michael 3 8.00 41.00 Rogers Sherry 1 16.50 30.00 Shepard Steven 3 10.90 45.50 --------------------------------------------------------------------------------
//PayrollReport.Txt
-----
Assume there are five parallel arrays holding the following data. lastNameArray firstNameArray deptArray rateArray Adams Paul 3 9.75 Allen Cindy 2 11.45 Allen Sarah 4 10,30 hoursArray 40.00 48.00 40.00 Your program should calculate the following values for the five parallel arrays shown below camingsArray ficaArray fedTaxArray state Tax Array netPay Array 390.00 27.30 85.80 19.50 257.40 595.40 41.68 130.99 29.77 392.96 412.00 28.84 90,64 20.60 271.92 Use the following formulas. base pay hours rate (for hours 40) overtime pay 0.0 (for hours a 40) Rate (hours - 40.0). 1.5 (for hours > 40) eamings - base pay + overtime pay fica = earnings . FICA_RATE fedTax = earnings . FED_TAX_RATE state Tax - earings .STATE_TAX_RATE netPay - earnings - (fica + fed Tax +state Tax) Add the project Review 1 to your solution workspace and make the following modifications. 1. Complete ParseLineln by adding the code to read data into the arrays that store first name, department, rate, and hours. 2. Complete DetailPayroll by adding the code to: a. calculate base pay for workers (two calculations) b. calculate overtime pay c. calculate earnings, fica, fedTax, state Tax, and netPay 3. Complete PrintReport by adding a for loop to write the last name, firstname, dept, rate, hours, earnings fica, fedTax, state Tax, and netPay 4. Complete the body of method Total so it will RETURN the total of its formal argument. 5. Complete the body of method Min so that it will RETURN the minimum of its formal argument. When completed, your output should look like the report shown on page 2. If your numbers differ from those given, you will lose points. Payroll Report First Name Dept Rate Hours Earnings FICA Fed Tax State Tax Net Pay Last Name Adams Allen Allen Baker Baker Baldwin Carson Freeman Garfield Grimes Harris Harris Lawson Mason Masters Patterson Peterson Randall Rogers Shepard Paul Cindy Sarah John Toni Cindy Robert Sally James Kerri Joan John LeAnn Debbie Kenneth Roseanne Paul Michael Sherry Steven 3 9.75 40.00 390.00 2 11.45 48.00 595.40 4 10.30 40.00 412.ee 1 22.00 43.25 987.25 1 12.65 40.ee 586.00 2 7.90 25.50 201.45 1 8.35 52.50 490.56 4 15.25 40.00 610.ee 3 22.ee 40.00 880.00 3 16.50 35.00 577.50 2 18.65 51.ee 1,053.72 2 9.00 47.50 461.25 4 17.85 40.00 714.00 4 22.80 41.50 929.50 3 16.10 40.25 650.04 2 13.70 38.ee 520.60 2 22.0 44.00 1,012.00 3 8.00 41.ee 332.ee 1 16.50 30.ee 495.00 3 10.90 45.50 525.93 27.30 41.68 28.84 69.11 35.42 14.10 34.34 42.70 61.60 40.43 73.76 32.29 49.98 65.07 45.50 36.44 70.84 23.24 34.65 36.82 85.80 130.99 90.64 217.20 111.32 44.32 107.92 134.20 193.60 127.05 231.82 101.48 157.08 204.49 143.01 114.53 222.64 73.04 108.90 115.70 19.se 29.77 20.60 49.36 25.30 10.07 24.53 30.50 44.ee 28.88 52.69 23.06 35.70 46.48 32.50 26.03 50.60 16.60 24.75 26.30 257.40 392.96 271.92 651.58 333.96 132.96 323.77 402.60 589.80 381.14 695.45 384.42 471.24 613.46 429.03 343.60 667.92 219.12 326.70 347.11 Total Mean Maximum Minimum 12,344.20 617.21 1,053.72 201.45 864.11 2,715.73 43.21 135.79 73.76 231.82 14.10 44.32 617.22 8,147.14 30.86 487.36 52.69 695.45 10.07 132.96
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
