CS101 Assignment 2 Solution Fall 2017

Note:  Students are required to submit HTML code file only with .html extension.Don’t upload word format file(.doc) etc.

You are required to write HTML with Java Script code to create Weight Converter Calculator web page which can be used to convert values entered in Kilo Gram to Gram, Pounds, Milligrams, US tons and Ounces respectively.

Solution guidelines of this  web page are given as follow,

  • You are required to create a text for taking input from the users in Kilo Grams. This text box can be labelled as Weight in KG.
  • The users will be required to enter their input in Weight in Kg.
  • Create one button labeled as Convert. On Mouse Click event the function “Converter” should be called to covert KG value to other units.
  • If no value or less than 0 is entered in KG text box and Covert button is clicked then alert should be shown through window.alert() as:
  • If the values is greater than 0 then your webpage will show converted values in Grams, Pounds, Milligrams, US tons and Ounces in the given text boxes as shown in sample output.
  • Create another button labeled as Reset Form to clear text box values.
  • You are required to use table so that items of the webpage will be shown in the arranged form.

Formula for KG to Grams conversion is:

Kilo Grams= KG*1000

Formula for KG to Pounds conversion is:

Pounds = KG* 2.2046

Formula for KG to Milligrams conversion is:

Milligrams = KG* 1000000

Formula for KG to Pounds conversion is:

US Ton = KG* 0.0011023

Formula for KG to Pounds conversion is:

Ounce = KG* 35.274

Sample Output (Snapshot): Color Scheme may be of your choice.

Download Here Solution cs101