Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions