+ 1
Can someone help me what will I add with my codes if I would deduct
Deductions following: Tax = 5% of gross pay Union =2 % of gross pay SaLoan = 509.32 (Fixed amount) Gross pay = (Hours > 40? 40 Ă Rate + Overtime pay: hours Ă rate) Deductions = Tax + Unit + SaLoan Net Pay = Gross Pay - Deductions int h, r,reg=40; Console.WriteLine("Hours of work"); h =Convert.ToInt16(Console.ReadLine()); Console.WriteLine("Rate"); r = Convert.ToInt16(Console.ReadLine()); double ot = (h - 40) * r * 1.5; if (h <= reg) { Console.WriteLine("Gross pay {0} ",h*r); } else if (h > reg) { Console.WriteLine("Gross pay: {0} ",40*r+ot);
1 Answer
0
May this is the correct otder of calculations...
Gross pay = (Hours > 40? 40 Ă Rate + Overtime pay: hours Ă rate)
Tax = 5% of gross pay
Union =2 % of gross pay
SaLoan = 509.32 (Fixed amount)
Deductions = Tax + Unit + SaLoan
Net Pay = Gross Pay - Deductions
But what is overtime pay, not mentioned anywhere..
And use Convert.ToInt32 instead of Toint16 otherwise it only converts upto 32000 only.. Above range of this as input will produce error..
Joyce If this is not helpfull, pls add full description...