IT 130: The Internet and the Web
Spring 2008
Assignment 6
Conditions and Counters
Due Friday May 23, Submit before 11:30pm
Overview
You will study and create Web pages that conditionally respond to user
input and events as well as count events. This is an individual
assignment.
Requirements
Create a Web page for each of the following exercises:
- Study the Weather page. Answer the
following questions on a Web page:
- Trace the code for a temperature of 10 and a humidity of "Dry".
Explain what happens in the code. Make sure you present function
calls, variable assignments and tested conditions.
- Trace the code for a temperature of 50 and a humidity of "Wet".
Explain what happens in the code. Make sure you present function
calls, variable assignments and tested conditions.
- What happens if the Temperature text box is left blank? Why?
- How does the function getDesc obtain the temperature and humidity values? Does it have any parameters? Explain.
- What does the function getDesc do with the
weather description? Does it use a return statement? Explain.
- On a separate page, modify the weather page so that it presents
weather descriptions that better fit your sensibilities (I'm guessing
that you wouldn't consider a picnic if it's 45 degrees and raining).
Your new page should provide at least six different weather
descriptions.
- Study the Dice 2 page. This is a
modified version of the dice page presented in chapter 11. Using a
few sentences, explain what happens when the button is pushed. Make
sure you present function calls, variable assignments, string
concatenations and image presentations.
- Modify the dice 2 page so that it has the following qualities (you
are strongly encouraged to take an incremental approach):
- Have your program count the number of dice rolls. Create a
new text box and display the number of dice rolls in the text
box. In addition to class notes, you may want to read about
Counters on pp. 206-208 in the Reed text.
- Have your program count the number of doubles. Create a
new text box and display the number of doubles in the text
box.
- Customize the presentation of your dice page with headers
and additional formatting.
Optional challenge: add a reset button to your dice page so that
counts are reset to zero when the reset button is pushed.
Once you have completed the Web pages above, create a navigation
page that provides links to the exercise pages. Format this page
using a suitable list. Add your name to this page.
Deliverables
Using the COL
submission, tell me the URL of your navigation page. Submit your URL
by 11:30pm on the due date.