CPSC 101B: Introduction to Computers

Spring 2003

JavaScript Homework 2

Due: Midnight, Monday, March 17, 2003.


  1. Write a page in HTML that contains a form. The form should contain three input boxes to allow the user to enter three numbers. The form should contain a button labelled "Compute Minimum". When the user clicks the button, the form should display in another input box the minimum of the three numbers the user entered.

  2. Write a page in HTML that contains a form. The form should contain three input boxes to allow the user to enter three numbers. The form should contain a button labelled "Is it a triangle?". When the user clicks the button, the form should display in another input box a message saying
    "There is a right-angle triangle with the given lengths for the three sides."
    or the message
    "There is no right-angle triangle with the given lengths for the three sides."
    in the appropriate cases. Note that in a right-angle triangle, the sum of the squares of its two sides at right-angles to each other is equal to the square of the third side, the hypotenuse.

Move your pages to your W drive, and send me in email the URLs of the two pages.