Homework Assignment Xtra
Due Wednesday, June 1, 2011
Some students have asked if there is anything else that can be done to improve their grade. This is it, an extra credit assignment. If you do this assignment, you have two options, A or B:
- Your grade on this assignment can take the place of your lowest Hw grade, OR
- Your grade on this assignment can earn you up to 15 additional points on your midterm exam.
The Assignment (name it Hw-Xtra.htm).
- I need to know which option you choose (A or B). So the first thing that should be displayed
on your page should be two radio buttons, like this:
Homework Midterm
or like this:Homework Midterm
Of course, which one is checked will depend on which option you pick. - Next, start by copying (to your PC) the temperature example given here,
temperature2.htm.
- Make the following improvements to temperature2.htm.
The new, improved version will be your Hw-Xtra.htm file.
- Make the page more attractive, i.e., center items, style items (color, size, type font, etc.),
and space the items nicely. - Add a reset button so when the user wants to start over he/she just needs to hit the button
and the form will be cleared. - Modify the convert() function so that:
- The form accepts either a Celsius temperature or a Fahrenheit temperature and then displays the equivalent temperature in the other text box.
- It informs the user if he/she has not entered a value in either box, and
- It informs the user if he/she has entered a non-number in a box.
To check if the user enters a non-number in a box, use the built-in JavaScript function isNaN(value)
When does all this informing take place? Immediately after the user presses the Convert button.
Whenever (ii) or (iii) occurs, use an alert() box to inform the user that he/she has made an error (print an appropriate message). After, the user dismisses the alert box, the cursor should be placed conveniently back in the appropriate text box (to give the user another chance). This can be done using the focus() method, like so
document.frmTemperature.txtCelsius.focus() for the Celsius box, or
document.frmTemperature.txtFahrenheit.focus() for the Fahrenheit box.
Old data will have to be erased from boxes, when necessary.
- Whenever the reset button is pressed, give the focus to the Celsius box.
- Screen shots: Opening screen No data Invalid data
- Make the page more attractive, i.e., center items, style items (color, size, type font, etc.),
- Use COLweb to submit the URL:
like → http://students.depaul.edu/~yourlogin/HCI201/Hw-Xtra.htm
Since there is just one line, please submit it in the comment box provided by the COLweb system . . . and check your url on the browser before you submit it.
See Submission Guidelines for details. - Important: This assignment must be submitted by the due date, absolutely no assignment will be accepted late.