I need help on the structure i need to use to get the correct answers to display.
I have a simple hours worked * payrate calculation but it gets confusing when trying to bring in NI and tax etc
My scenario short ver:
Paid an hourly wage
If hours are over 40 they are paid overtime 1.5x the amount normally
NI deducted gross pay 9% (0.09)
gross pay before tax
net pay after tax
income tax 25% of anything earned over £80 - first £80 is tax free
surely im wrong in trying
If hours worked =< 40
then perform payrate * hours as i have done
else if
hours worked + overtime? (im lost, hours-40 * 1.5 then + 40) Its not right but all input i have sry lol
NI 0.09-pay
store as netpay
if netpay => 80 then
netpay - 0.25%
else output pay
Its not that complicated atall but im making a mess as you can see, and want to get this working, all help apprecaited!
global variables
I have a simple hours worked * payrate calculation but it gets confusing when trying to bring in NI and tax etc
My scenario short ver:
Paid an hourly wage
If hours are over 40 they are paid overtime 1.5x the amount normally
NI deducted gross pay 9% (0.09)
gross pay before tax
net pay after tax
income tax 25% of anything earned over £80 - first £80 is tax free
surely im wrong in trying
If hours worked =< 40
then perform payrate * hours as i have done
else if
hours worked + overtime? (im lost, hours-40 * 1.5 then + 40) Its not right but all input i have sry lol
NI 0.09-pay
store as netpay
if netpay => 80 then
netpay - 0.25%
else output pay
Its not that complicated atall but im making a mess as you can see, and want to get this working, all help apprecaited!
global variables
Code:
int hoursWorked = 0; //Declaring variable as interger
double payRate = 0.0; //Declaring variable as Decimal
double pay = 0.0; //Declares variable as decimal
Code:
private void payCalc(int hoursWorked, double payRate)
{
pay = hoursWorked * payRate; //calculation used for form
MessageBox.Show("Your pay is: " + pay); //display messagebox
}
private void btnSubmit_Click(object sender, EventArgs e)
{
hoursWorked = int.Parse(txtHours.Text); //This converts it from textbox into integer and puts it in hoursworked
payRate = double.Parse(txtPayrate.Text); //This converts text from txtpay into integer and into payrate variable
payCalc(hoursWorked, payRate);
}