CSCE 145: Lab 26

An Active JavaScript Web Page for Performing Metric Conversions

Objectives

In this lab you will learn more about JavaScript

Program Specification

The purpose of this lab is for you to learn about building active Web pages using JavaScript. You should use JavaScript to construct a Web page that helps a user with metric conversions.

Design Details

You can use Eclipse, notepad, emacs, or any other text editor for this lab.

Your Web page should have

Your program should allow the user to specify the names of the units as strings (e.g., centimeters, liters, and grams for the metric system and inches, quarts, and pounds for the English system) and should respond to simple questions, such as

"How many inches are in 2 meters?"

"How many liters are in 10 quarts?"

Your program should recognize invalid conversions, such as

"How many feet in 5 kilograms?"

is not a meaningful question.

Demonstrate your program to your TA by showing him your Web page, and then upload your source code (an .html file) to the dropbox at https://dropbox.cse.sc.edu.