I am in my first year of a programming course and have an assignment using c sharp where we have to make a payroll calculator which calculates gross pay, tax, net pay and superannuation contribution. I am ABSOLUTLEY stuck on one part and was hoping someone can help.
Basically, we are given a csv file with the tax rates included and a formula to use the values in the csv file. The file is formatted so that the first and second colum is the range of $ amount an employee earns (x), the next is value (a) and the next is value (b). The formula to work out the tax rate is y = ax -b where y is the tax amount in dollars, x is the weekly earnings plus 99 cents and a and be are the values in colums 3 and 4. So if I was to earn $575 for a week the calculation woudl be (0.3477 x 575.99) – 64.4297 = result needed (its about $135)
enter image description here
My plan was to import the csv into an array or list and then use a switch statemnt to parse through the amount earned ranges to find the relevant a and b values. I can’t quite work out how to do this though. Any tips and idea please…… even different strategies.
Steve Xine is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.