FIT100 Fluency With Information Technology

Lab 9

“Espresso Scavenger Hunt”

 

A scavenger hunt – a game of trying to collect a set of unusual things – is used as a metaphor for looking around the Bean Counter program of Chapter 18.  Though the content of the Bean Counter program is not so “unusual” – it’s normal HTML and JavaScript – these languages are not yet so familiar to you.  The educational goal is to become more familiar with HTML, JavaScript and the terminology of the two, and to become accustomed to navigating around in a large program.  (All answers are given in Chapter 18.)

 

1.  Move a copy of the Bean Counter Version 2 to your desktop.  The program is with the rest of the textbook related files:  www.aw.com/snyder/

 

The following questions can be answered by viewing the page source.

 

2.  Find the third global variable declared in the program. _________________________

 

3.  The application has many buttons and text inputs that must be specified in a form. Forms have names specified as an attribute to the tag. What is the name of the form used in Bean Counter? ________________________

 

4.  The Bean Counter application is a table within a table.  How many other HTML tags are between the two <table> tags?  __________________

 

5.  Input controls have names specified as attributes in the tag.  What is the name of the third (from the beginning of the program) input control? ____________________

 

6.  What is the first (closest to the beginning of the program) event handler?  Copy it out:

________________________

 

7.  When programming event handlers, the easiest way to figure out what to do is to ask, “What should happen next when this event occurs?”  Say in English what is happening when the event handler of Question 6 occurs, i.e. what do the two statements of the event handler do? _________________

 

8.  How many JavaScript statements are there in the event handler for the clear button? __________________

 

9.  What is the size in ounces of the grande (G) drinks? ____________

 

10.  What is the base price (without tax) for an Americano?  _____________

 

To Do

 

Make the following modifications to the Bean Counter Program.

 

1.  Change the label of the clear button to “ZAP”.  If the button is not the same size as the others, pad it with blanks to make it more nearly the right size.

 

2.  Change the base price of Americanos to 1.40. What is the cost of a double, tall Americao? 

 

3.  In the “open space” on the bottom row of the Bean Counter display, put your initials.

 

4. Change the border of the “Total” box to be blue.

 

5.  Change the printing of your initials (Ex. 3) to print in white.