Homework 2


(20 PTS) 1.  Create an index.html page that contains the links to all of your homework and several of our class examples to be used as the homepage in your directory at jasperations.net.


Sum of Powers Sticky Form (40 PTS) 1.  Create a sticky form that gets two inputs from the user

  • the number of positive integers, from 1 to N, they want to sum
  • the power that each term should be raised to before summing

Then you should display the result in a third text box.  You should call the page sticky_sum.jsp.


Sticky Form (34 PTS) 2.  You need to create a sticky form called sticky_inputs.jsp that does the following.

  • gets a username
  • uses a group of radio buttons to determine what University they are attending
    • Quinnipiac
    • Yale
    • UConn
  • presents some check boxes for the user to click for their favorite past times
    • partying
    • sports
    • studying
    • travel
  • uses a list box to assign a range for their annual income
    • less than 20000
    • from 20000 up to 40000
    • from 40000 up to 60000
    • more than 60000
  • gives them a text area to describe themselves

You also need to do some input validation to make certain they have entered something for the username, selected at least one university and selected some income range.  If they haven't, you need to give them appropriate feedback on the page above the form.  If they have supplied all the required information you need to tell them this.