Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
Major help needed - Assignment due tomorrow
Post Flair (click to view more posts with a particular flair)
Post Body

Hi,

I need some major help and I don't know if you can. I have an assignment due tomorrow and I've tried time and time again to work this out on my own and I've failed. I don't expect anyone to do this for me but I need help figuring out where I've messed and how I fix it.

My code has basically been created by using examples from the lecturer.

The task:

To create a payroll page that lists all the employees, their salary, the tax they pay and monthly income, to then click through on each person and see their individual payslip.

The minimum requirements of the project are this -

• Read the JSON input file of employee data to import a list of employees and their salaries

• Import tax tables from the JSON file to determine what rate of tax each employee will pay

• Produce a list of all employees with their monthly take-home (net, after tax) pay

• Calculate tax home-page (‘net’ or after tax) for each employee for the current month

• Display a list of all employees

• Allow click-through to individual employee’s payslip

So far I have been able to read and import the 2 JSON files, have displayed a list of all the employees in a table and set up a click through to each individual payslip.

What I can't get to work is the functions to calculate tax band(it's graduated so say someone is in tax band 3, they have to go through the 3 tax bands and pay appropriate tax on each) and then how much tax each employee is paying, what their net salary is and finally what their monthly is.

I keep getting warnings and errors about syntax errors (it doesn't like the switch or it doesn't like the foreach), parse errors or undefined variables.

The code: https://pastebin.com/0JvMFz7f

JSON - Employee Data: https://pastebin.com/Ge2kq9zY

JSON - Tax Data: https://pastebin.com/3BAteb4s

Can anyone help me put of my misery? Otherwise this is how I'm submitting my code tomorrow.

Author
Account Strength
100%
Account Age
8 years
Verified Email
Yes
Verified Flair
No
Total Karma
7,066
Link Karma
2,806
Comment Karma
4,067
Profile updated: 28 minutes ago
Posts updated: 10 hours ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago