Question: IN JAVA SCRIPT write code in this function that takes the salary amount as a parameter, and calculates the tax payable at a rate of
IN JAVA SCRIPT
write code in this function that takes the salary amount as a parameter, and calculates the tax payable at a rate of 30%. If the salary is over 45000 add an extra 5000 to the tax. Subtract the tax from the original salary to get the net salary amount.
The function should return an array containing the total amount of tax at index 0 and the net salary at index 1.
function workoutTax001(numSalary) {
//insert code here
//arrReturn needs declaring and populating
return arrReturn;
}
afterwards;
write code in this function to prompt a user to enter their salary. Call the workoutTax001 function from above to calculate the total tax and net salary. Display the results in an alert message to the user.
function calculateTax001() {
//DONT FORGET to call the function!!
}
//call the calcTax001 function to run it!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
