Generate a C# windows form program based on the example on the next page with th
ID: 3589079 • Letter: G
Question
Generate a C# windows form program based on the example on the next page with the following conditions.
Rename the default form1 class to the name of your program and add to the form text title bar the name of your program. Also rename the form1.cs file in the Solution View window to FormProgram.cs
NOTE: these rates are not the same as the examples below.
Federal Tax Rate =16%;
State Tax Rate = 5.5%;
FDIC Tax Rate = 4.8%;
Health Insurance Rate = 3.8%;
Personal Saving Rate = 4%;
Please implement a PayCheck class. You must pass the hours worked and hourly pay rate amount as parameters in the class constructor. The constructor must also initialize all the tax rate variables. You mustimplement all the tax rate variables as Properties so that they may be easily changed if necessary.
You must have the following methods to calculate the various values: Federal Tax Amount, State Tax Amount, FDIC Tax Amount, Health Insurance Amount, Personal Saving Amount, Gross Pay Amount, Base Pay Amount, Over Time Pay Amount, and Check Amount. You may also need other methods as well.
You may create the PayCheck object inside the CalculatePay_Clicked()method and call the necessary methods to calculate the various values.
Explanation / Answer
Check Program File:
The Programe is working as expected.
FormProgram.Designer.cs
namespace FormProgram
{
partial class FormProgram
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.CalculatePay = new System.Windows.Forms.Button();
this.txtHoursWorked = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.rdoWeekWorkded = new System.Windows.Forms.RadioButton();
this.rdoYearWorkded = new System.Windows.Forms.RadioButton();
this.rdoMonthWorkded = new System.Windows.Forms.RadioButton();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txthourlyPayRate = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.richTextBoxOutPut = new System.Windows.Forms.RichTextBox();
this.label6 = new System.Windows.Forms.Label();
this.txtOverTimeHrs = new System.Windows.Forms.TextBox();
this.BasePayAmt = new System.Windows.Forms.Button();
this.FrdPayAmt = new System.Windows.Forms.Button();
this.StatePayAmt = new System.Windows.Forms.Button();
this.FDICPayAmt = new System.Windows.Forms.Button();
this.HealthPayAmt = new System.Windows.Forms.Button();
this.PersonalPayAmt = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// CalculatePay
//
this.CalculatePay.Location = new System.Drawing.Point(12, 315);
this.CalculatePay.Name = "CalculatePay";
this.CalculatePay.Size = new System.Drawing.Size(137, 28);
this.CalculatePay.TabIndex = 0;
this.CalculatePay.Text = "Gross Pay Amount";
this.CalculatePay.UseVisualStyleBackColor = true;
this.CalculatePay.Click += new System.EventHandler(this.CalculatePay_Click);
//
// txtHoursWorked
//
this.txtHoursWorked.Location = new System.Drawing.Point(241, 116);
this.txtHoursWorked.Name = "txtHoursWorked";
this.txtHoursWorked.Size = new System.Drawing.Size(103, 20);
this.txtHoursWorked.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(0, 123);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(96, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Amount Calculated";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(14, 9);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(35, 13);
this.label2.TabIndex = 3;
this.label2.Text = "select";
//
// rdoWeekWorkded
//
this.rdoWeekWorkded.AutoSize = true;
this.rdoWeekWorkded.Location = new System.Drawing.Point(125, 4);
this.rdoWeekWorkded.Name = "rdoWeekWorkded";
this.rdoWeekWorkded.Size = new System.Drawing.Size(127, 17);
this.rdoWeekWorkded.TabIndex = 4;
this.rdoWeekWorkded.TabStop = true;
this.rdoWeekWorkded.Text = "radio Week Workded";
this.rdoWeekWorkded.UseVisualStyleBackColor = true;
//
// rdoYearWorkded
//
this.rdoYearWorkded.AutoSize = true;
this.rdoYearWorkded.Location = new System.Drawing.Point(125, 52);
this.rdoYearWorkded.Name = "rdoYearWorkded";
this.rdoYearWorkded.Size = new System.Drawing.Size(120, 17);
this.rdoYearWorkded.TabIndex = 5;
this.rdoYearWorkded.TabStop = true;
this.rdoYearWorkded.Text = "radio Year Workded";
this.rdoYearWorkded.UseVisualStyleBackColor = true;
//
// rdoMonthWorkded
//
this.rdoMonthWorkded.AutoSize = true;
this.rdoMonthWorkded.Location = new System.Drawing.Point(125, 29);
this.rdoMonthWorkded.Name = "rdoMonthWorkded";
this.rdoMonthWorkded.Size = new System.Drawing.Size(128, 17);
this.rdoMonthWorkded.TabIndex = 6;
this.rdoMonthWorkded.TabStop = true;
this.rdoMonthWorkded.Text = "radio Month Workded";
this.rdoMonthWorkded.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(139, 123);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(66, 13);
this.label3.TabIndex = 7;
this.label3.Text = "No.Of Hours";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(141, 155);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(76, 13);
this.label4.TabIndex = 8;
this.label4.Text = "hourlyPayRate";
//
// txthourlyPayRate
//
this.txthourlyPayRate.Location = new System.Drawing.Point(241, 152);
this.txthourlyPayRate.Name = "txthourlyPayRate";
this.txthourlyPayRate.Size = new System.Drawing.Size(103, 20);
this.txthourlyPayRate.TabIndex = 9;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(56, 225);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(40, 13);
this.label5.TabIndex = 10;
this.label5.Text = "OutPut";
//
// richTextBoxOutPut
//
this.richTextBoxOutPut.Location = new System.Drawing.Point(241, 200);
this.richTextBoxOutPut.Name = "richTextBoxOutPut";
this.richTextBoxOutPut.Size = new System.Drawing.Size(301, 74);
this.richTextBoxOutPut.TabIndex = 11;
this.richTextBoxOutPut.Text = "";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(350, 119);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(121, 13);
this.label6.TabIndex = 12;
this.label6.Text = "Over Time Hours (if any)";
//
// txtOverTimeHrs
//
this.txtOverTimeHrs.Location = new System.Drawing.Point(488, 116);
this.txtOverTimeHrs.Name = "txtOverTimeHrs";
this.txtOverTimeHrs.Size = new System.Drawing.Size(103, 20);
this.txtOverTimeHrs.TabIndex = 13;
this.txtOverTimeHrs.Text = "0";
this.txtOverTimeHrs.UseWaitCursor = true;
//
// BasePayAmt
//
this.BasePayAmt.Location = new System.Drawing.Point(207, 315);
this.BasePayAmt.Name = "BasePayAmt";
this.BasePayAmt.Size = new System.Drawing.Size(137, 28);
this.BasePayAmt.TabIndex = 14;
this.BasePayAmt.Text = "Base Pay Amount";
this.BasePayAmt.UseVisualStyleBackColor = true;
this.BasePayAmt.Click += new System.EventHandler(this.BasePayAmt_Click);
//
// FrdPayAmt
//
this.FrdPayAmt.Location = new System.Drawing.Point(405, 315);
this.FrdPayAmt.Name = "FrdPayAmt";
this.FrdPayAmt.Size = new System.Drawing.Size(137, 28);
this.FrdPayAmt.TabIndex = 15;
this.FrdPayAmt.Text = "Federal Tax Amount";
this.FrdPayAmt.UseVisualStyleBackColor = true;
this.FrdPayAmt.Click += new System.EventHandler(this.FrdPayAmt_Click);
//
// StatePayAmt
//
this.StatePayAmt.Location = new System.Drawing.Point(575, 315);
this.StatePayAmt.Name = "StatePayAmt";
this.StatePayAmt.Size = new System.Drawing.Size(137, 28);
this.StatePayAmt.TabIndex = 16;
this.StatePayAmt.Text = "State Tax Amount";
this.StatePayAmt.UseVisualStyleBackColor = true;
this.StatePayAmt.Click += new System.EventHandler(this.StatePayAmt_Click);
//
// FDICPayAmt
//
this.FDICPayAmt.Location = new System.Drawing.Point(12, 385);
this.FDICPayAmt.Name = "FDICPayAmt";
this.FDICPayAmt.Size = new System.Drawing.Size(137, 28);
this.FDICPayAmt.TabIndex = 17;
this.FDICPayAmt.Text = "FDIC Tax Amount";
this.FDICPayAmt.UseVisualStyleBackColor = true;
this.FDICPayAmt.Click += new System.EventHandler(this.FDICPayAmt_Click);
//
// HealthPayAmt
//
this.HealthPayAmt.Location = new System.Drawing.Point(192, 385);
this.HealthPayAmt.Name = "HealthPayAmt";
this.HealthPayAmt.Size = new System.Drawing.Size(137, 28);
this.HealthPayAmt.TabIndex = 18;
this.HealthPayAmt.Text = "Health Insurance Amount";
this.HealthPayAmt.UseVisualStyleBackColor = true;
this.HealthPayAmt.Click += new System.EventHandler(this.HealthPayAmt_Click);
//
// PersonalPayAmt
//
this.PersonalPayAmt.Location = new System.Drawing.Point(377, 385);
this.PersonalPayAmt.Name = "PersonalPayAmt";
this.PersonalPayAmt.Size = new System.Drawing.Size(137, 28);
this.PersonalPayAmt.TabIndex = 19;
this.PersonalPayAmt.Text = "Personal Saving Amount";
this.PersonalPayAmt.UseVisualStyleBackColor = true;
this.PersonalPayAmt.Click += new System.EventHandler(this.PersonalPayAmt_Click);
//
// FormProgram
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(779, 441);
this.Controls.Add(this.PersonalPayAmt);
this.Controls.Add(this.HealthPayAmt);
this.Controls.Add(this.FDICPayAmt);
this.Controls.Add(this.StatePayAmt);
this.Controls.Add(this.FrdPayAmt);
this.Controls.Add(this.BasePayAmt);
this.Controls.Add(this.txtOverTimeHrs);
this.Controls.Add(this.label6);
this.Controls.Add(this.richTextBoxOutPut);
this.Controls.Add(this.label5);
this.Controls.Add(this.txthourlyPayRate);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.rdoMonthWorkded);
this.Controls.Add(this.rdoYearWorkded);
this.Controls.Add(this.rdoWeekWorkded);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtHoursWorked);
this.Controls.Add(this.CalculatePay);
this.Name = "FormProgram";
this.Text = "FormProgram";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button CalculatePay;
private System.Windows.Forms.TextBox txtHoursWorked;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.RadioButton rdoWeekWorkded;
private System.Windows.Forms.RadioButton rdoYearWorkded;
private System.Windows.Forms.RadioButton rdoMonthWorkded;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txthourlyPayRate;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.RichTextBox richTextBoxOutPut;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtOverTimeHrs;
private System.Windows.Forms.Button BasePayAmt;
private System.Windows.Forms.Button FrdPayAmt;
private System.Windows.Forms.Button StatePayAmt;
private System.Windows.Forms.Button FDICPayAmt;
private System.Windows.Forms.Button HealthPayAmt;
private System.Windows.Forms.Button PersonalPayAmt;
}
}
FormProgram.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FormProgram
{
public partial class FormProgram : Form
{
public FormProgram()
{
InitializeComponent();
}
public int noOfDays = 0;
public enum NoOfDays
{
Week=7,
Month=30,
Year=365
}
public void Validate()
{
if (rdoWeekWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Week);
}
if (rdoMonthWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Month);
}
if (rdoYearWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Year);
}
if (!rdoWeekWorkded.Checked && !rdoMonthWorkded.Checked && !rdoYearWorkded.Checked)
{
MessageBox.Show("radio button must be checked not be blanked ");
}
else if (string.IsNullOrWhiteSpace(txtHoursWorked.Text))
{
MessageBox.Show("Hours Worked textbox not be blanked ");
}
}
private void CalculatePay_Click(object sender, EventArgs e)
{
if (rdoWeekWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Week);
}
if (rdoMonthWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Month);
}
if (rdoYearWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Year);
}
if (!rdoWeekWorkded.Checked && !rdoMonthWorkded.Checked && !rdoYearWorkded.Checked)
{
MessageBox.Show("radio button must be checked not be blanked ");
}
else if (string.IsNullOrWhiteSpace(txtHoursWorked.Text))
{
MessageBox.Show("Hours Worked textbox not be blanked ");
}
else {
PayCheck objPayCheck = new PayCheck(Convert.ToInt32(txtHoursWorked.Text), Convert.ToInt64(txthourlyPayRate.Text), Convert.ToInt32(noOfDays), Convert.ToInt32(txtOverTimeHrs.Text));
richTextBoxOutPut.Text= objPayCheck.GrossPayAmount().ToString();
}
}
private void BasePayAmt_Click(object sender, EventArgs e)
{
if (rdoWeekWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Week);
}
if (rdoMonthWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Month);
}
if (rdoYearWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Year);
}
if (!rdoWeekWorkded.Checked && !rdoMonthWorkded.Checked && !rdoYearWorkded.Checked)
{
MessageBox.Show("radio button must be checked not be blanked ");
}
else if (string.IsNullOrWhiteSpace(txtHoursWorked.Text))
{
MessageBox.Show("Hours Worked textbox not be blanked ");
}
else
{
PayCheck objPayCheck = new PayCheck(Convert.ToInt32(txtHoursWorked.Text), Convert.ToInt64(txthourlyPayRate.Text), Convert.ToInt32(noOfDays), Convert.ToInt32(txtOverTimeHrs.Text));
richTextBoxOutPut.Text = objPayCheck.BasePayAmount().ToString();
}
}
private void FrdPayAmt_Click(object sender, EventArgs e)
{
if (rdoWeekWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Week);
}
if (rdoMonthWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Month);
}
if (rdoYearWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Year);
}
if (!rdoWeekWorkded.Checked && !rdoMonthWorkded.Checked && !rdoYearWorkded.Checked)
{
MessageBox.Show("radio button must be checked not be blanked ");
}
else if (string.IsNullOrWhiteSpace(txtHoursWorked.Text))
{
MessageBox.Show("Hours Worked textbox not be blanked ");
}
else
{
PayCheck objPayCheck = new PayCheck(Convert.ToInt32(txtHoursWorked.Text), Convert.ToInt64(txthourlyPayRate.Text), Convert.ToInt32(noOfDays), Convert.ToInt32(txtOverTimeHrs.Text));
richTextBoxOutPut.Text = objPayCheck.FDICTaxAmount().ToString();
}
}
private void StatePayAmt_Click(object sender, EventArgs e)
{
if (rdoWeekWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Week);
}
if (rdoMonthWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Month);
}
if (rdoYearWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Year);
}
if (!rdoWeekWorkded.Checked && !rdoMonthWorkded.Checked && !rdoYearWorkded.Checked)
{
MessageBox.Show("radio button must be checked not be blanked ");
}
else if (string.IsNullOrWhiteSpace(txtHoursWorked.Text))
{
MessageBox.Show("Hours Worked textbox not be blanked ");
}
else
{
PayCheck objPayCheck = new PayCheck(Convert.ToInt32(txtHoursWorked.Text), Convert.ToInt64(txthourlyPayRate.Text), Convert.ToInt32(noOfDays), Convert.ToInt32(txtOverTimeHrs.Text));
richTextBoxOutPut.Text = objPayCheck.StateTaxAmount().ToString();
}
}
private void FDICPayAmt_Click(object sender, EventArgs e)
{
if (rdoWeekWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Week);
}
if (rdoMonthWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Month);
}
if (rdoYearWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Year);
}
if (!rdoWeekWorkded.Checked && !rdoMonthWorkded.Checked && !rdoYearWorkded.Checked)
{
MessageBox.Show("radio button must be checked not be blanked ");
}
else if (string.IsNullOrWhiteSpace(txtHoursWorked.Text))
{
MessageBox.Show("Hours Worked textbox not be blanked ");
}
else
{
PayCheck objPayCheck = new PayCheck(Convert.ToInt32(txtHoursWorked.Text), Convert.ToInt64(txthourlyPayRate.Text), Convert.ToInt32(noOfDays), Convert.ToInt32(txtOverTimeHrs.Text));
richTextBoxOutPut.Text = objPayCheck.FDICTaxAmount().ToString();
}
}
private void HealthPayAmt_Click(object sender, EventArgs e)
{
if (rdoWeekWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Week);
}
if (rdoMonthWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Month);
}
if (rdoYearWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Year);
}
if (!rdoWeekWorkded.Checked && !rdoMonthWorkded.Checked && !rdoYearWorkded.Checked)
{
MessageBox.Show("radio button must be checked not be blanked ");
}
else if (string.IsNullOrWhiteSpace(txtHoursWorked.Text))
{
MessageBox.Show("Hours Worked textbox not be blanked ");
}
else
{
PayCheck objPayCheck = new PayCheck(Convert.ToInt32(txtHoursWorked.Text), Convert.ToInt64(txthourlyPayRate.Text), Convert.ToInt32(noOfDays), Convert.ToInt32(txtOverTimeHrs.Text));
richTextBoxOutPut.Text = objPayCheck.HealthInsuranceAmount().ToString();
}
}
private void PersonalPayAmt_Click(object sender, EventArgs e)
{
if (rdoWeekWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Week);
}
if (rdoMonthWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Month);
}
if (rdoYearWorkded.Checked)
{
noOfDays = Convert.ToInt32(NoOfDays.Year);
}
if (!rdoWeekWorkded.Checked && !rdoMonthWorkded.Checked && !rdoYearWorkded.Checked)
{
MessageBox.Show("radio button must be checked not be blanked ");
}
else if (string.IsNullOrWhiteSpace(txtHoursWorked.Text))
{
MessageBox.Show("Hours Worked textbox not be blanked ");
}
else
{
PayCheck objPayCheck = new PayCheck(Convert.ToInt32(txtHoursWorked.Text), Convert.ToInt64(txthourlyPayRate.Text), Convert.ToInt32(noOfDays), Convert.ToInt32(txtOverTimeHrs.Text));
richTextBoxOutPut.Text = objPayCheck.PersonalSavingAmount().ToString();
}
}
}
}
PayCheck.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FormProgram
{
public class PayCheck
{
private double _FederalTaxRate = 16;
private double _StateTaxRate = 5.5;
private double _FDICTaxRate = 4.8;
private double _HealthTaxRate = 3.8;
private double _PersonalTaxRate = 4;
public int hrWorked = 0;
public int numberOfDays = 0;
public double hourlyPayRate = 0;
public int overTimeHrs = 0;
public double FederalTaxRate { get { return _FederalTaxRate; } }
public double StateTaxRate { get { return _StateTaxRate; } }
public double FDICTaxRate { get { return _FDICTaxRate; } }
public double HealthTaxRate { get { return _HealthTaxRate; } }
public double PersonalTaxRate { get { return _PersonalTaxRate; } }
public PayCheck(int hrWorked,double hourlyPayRate,int numberOfDays,int overTimeHrs)
{
this.hrWorked = hrWorked;
this.hourlyPayRate = hourlyPayRate;
this.numberOfDays = numberOfDays;
this.overTimeHrs = overTimeHrs;
}
public double GrossPayAmount()
{
int totalHrWorked = hrWorked + overTimeHrs;
double perDayEarnings = (totalHrWorked * hourlyPayRate);
double TotalDayEarnings = perDayEarnings * numberOfDays;
double CalFederalTaxRate = (TotalDayEarnings * FederalTaxRate) / 100;
double CalStateTaxRate = (TotalDayEarnings * StateTaxRate) / 100;
double CalFDICTaxRate = (TotalDayEarnings * FDICTaxRate) / 100;
double CalHealthTaxRate = (TotalDayEarnings * HealthTaxRate) / 100;
double CalPersonalTaxRate = (TotalDayEarnings * PersonalTaxRate) / 100;
double TotalGrossPayAmount = TotalDayEarnings + CalFederalTaxRate + CalStateTaxRate + CalFDICTaxRate + CalHealthTaxRate + CalPersonalTaxRate;
return TotalGrossPayAmount;
}
public double FederalTaxAmount()
{
int totalHrWorked = hrWorked + overTimeHrs;
double perDayEarnings = (totalHrWorked * hourlyPayRate);
double TotalDayEarnings = perDayEarnings * numberOfDays;
double CalFederalTaxRate = (TotalDayEarnings * FederalTaxRate) / 100;
double TotalFederalPayAmount = TotalDayEarnings + CalFederalTaxRate;
return TotalFederalPayAmount;
}
public double StateTaxAmount()
{
int totalHrWorked = hrWorked + overTimeHrs;
double perDayEarnings = (totalHrWorked * hourlyPayRate);
double TotalDayEarnings = perDayEarnings * numberOfDays;
double CalStateTaxRate = (TotalDayEarnings * StateTaxRate) / 100;
double TotalStatePayAmount = TotalDayEarnings + CalStateTaxRate;
return TotalStatePayAmount;
}
public double FDICTaxAmount()
{
int totalHrWorked = hrWorked + overTimeHrs;
double perDayEarnings = (totalHrWorked * hourlyPayRate);
double TotalDayEarnings = perDayEarnings * numberOfDays;
double CalFDICTaxRate = (TotalDayEarnings * FDICTaxRate) / 100;
double TotalFDICPayAmount = TotalDayEarnings + CalFDICTaxRate;
return TotalFDICPayAmount;
}
public double HealthInsuranceAmount()
{
int totalHrWorked = hrWorked + overTimeHrs;
double perDayEarnings = (totalHrWorked * hourlyPayRate);
double TotalDayEarnings = perDayEarnings * numberOfDays;
double CalHealthTaxRate = (TotalDayEarnings * HealthTaxRate) / 100;
double TotalHealthPayAmount = TotalDayEarnings + CalHealthTaxRate;
return TotalHealthPayAmount;
}
public double PersonalSavingAmount()
{
int totalHrWorked = hrWorked + overTimeHrs;
double perDayEarnings = (totalHrWorked * hourlyPayRate);
double TotalDayEarnings = perDayEarnings * numberOfDays;
double CalPersonalTaxRate = (TotalDayEarnings * PersonalTaxRate) / 100;
double TotalPersonalPayAmount = TotalDayEarnings + CalPersonalTaxRate;
return TotalPersonalPayAmount;
}
public double BasePayAmount()
{
int totalHrWorked = hrWorked + overTimeHrs;
double perDayEarnings = (totalHrWorked * hourlyPayRate);
double TotalDayEarnings = perDayEarnings * numberOfDays;
return TotalDayEarnings;
}
public double CheckAmount() {
//need to implement based on need.
return 0;
}
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.