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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started