You wish to create a (very) simple prototype of a company's shipping cost estimator. To do so, ask the user the weight of the item they are shipping.

  • If the item is less than 1 pound, the cost is $5.
  • If the item is 1 pound or more, and less than 3 pounds, the cost is $10.
  • If the item is 3 pounds or more, and less than 5 pounds, the cost is $15.

We will assume that all items are less than 5 pounds, so you don't have to go beyond that in your code.

Also, if they are a member of the company's "Frequent Shipper" program they get $3 deducted from their shipping cost.

Instructions:

1. See the HTML code with the title: "Common Shipper" attached to the end of this exam.

2. Write a function that will examine the text field that asks for the weight of the item. Retrieve this value.

3. Examine the radio button asking if the user is a member of the frequent shipping program. If they checked 'Yes' then reduce the cost of their shipping by $3.

4. Output their shipping cost inside the div section labeled 'output' below*.

Common Question


< html lang="en" >
< head >
< meta charset="utf-8" >
< title >Common Question IT-130 < /title >
< script type="text/javascript" >
// YOUR FUNCTION WOULD GO HERE
< /script >
< /head >
< body >
< h1 >Common Question IT-130 < /h1 >
< hr >
Are you a member of our Frequent Shipping program? < br >
Yes < input type="radio" name="radFreqShip" id="freq" > < br >
No < input type="radio" name="radFreqShip" id="notFreq" > < br >
< input type="button" value="Calculate Shipping Cost" onclick="calcShipping()" >
< div id="output" >
< /div >
< /html >
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.