IT 130: The Internet and the Web
Fall 2011
Assignment 6
Conditions and Counters
Due Sunday October 30, 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.
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?
- How does the function GetDesc display the
weather description? 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. 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.
- 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.
Greater optional challenge: have your page keep track if doubles is
rolled three times in a roll. If it is, provide a message of your
choosing. Testing this option can be challenge (which you should
do).
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 D2L
submission, tell me the URL of your navigation page. Submit your URL
by 11:30pm on the due date.