Question: Create a Web page that does the following. Write a function computeTax(itemCost,taxRate) to compute the sales tax of the item (i.e. ItemCost x taxRate). Be

Create a Web page that does the following. Write a function computeTax(itemCost,taxRate) to compute the sales tax of the item (i.e. ItemCost x taxRate).

Be sure to place the function declaration in the head section of your document, inside script tags. Then in the body section, add script tags and include JavaScript code that prompts the user to input the cost for the item and taxRate to pay. Store this input in two variables, itemCost and taxRate. Then write a function call to computeTax, passing the values input to the functions. The computeTax function will compute the tax and returns the value to the caller. The value will be displayed using the alert box (i.e. "Your tax amount is $1.60 ")

- Your computeTax function must return the computed tax value using the "return" keyword. - Your computeTax function should not have alert and document.write in it. The output should be displayed by the main body - Do not use console.log to display results. You must used either alert box or document.write. - you must use prompt as taught in class - You must declare variables - You must use document.write or Alert output- You must use parseFloat - You must Personalize the page with your photo on the top - You must NOT use console.log, Input, Type, Events - These are advanced topics. This was not part of the lecture.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!