COMS303 E-Commerce Scripting Languages

Arrays Lab

Instructions:

Make a copy of this page and move it to your work area.  Place this and any additional files or folders in a folder labeled COMS303-Arrays-Lab.  Make the following changes to the lower part of this page using client side javascript.  You will need to add information in both the head and body section in order to apply the desired results. You will also need to remove some of the form handling added by the HTML page editor.  

Add the following affects to the the Burger Barn order page.

  1. The image should be a banner rotator using the images from the BurgerBarn folder in the class folder on the N: drive.
  2. Create an array called 'arrMealCosts' that contains the costs of the Barnyard meals.  
  3. Use this array to determine which cost to use in the calculations based upon the selected meal.  
  4. Create an array called 'arrSidesCost' containing the costs of the Sides from the the form.  
  5. Using the selected option  from the 'Sides' drop down box get the correct cost of the sides from the array.
  6. If the order is Barn Sized then add $1.00 to the total order.
  7. The value of Total Order is the cost of the meal plus the cost of a side plus the Barn Size modifier if any.
  8. The returned value Total Order should be formatted using dollarFormat function.

When finished post the folder labeled COMS303-Arrays-Lab to your folder on the student server.

Extra Credit:  Create an array containing the sides.  Use this array to create the drop down box by using a loop to read through the array and create the drop down box as the page is rendered. 


Welcome to Burger Barn!

Please enter your order using the form below:

Which Barnyard Meal would you like: 

1 
2-Hamburgers  $1.99  
2 
2-Cheeseburgers $2.19
3 
2-Barnburgers $2.99
4 
1-Hamburger $1.09

What Side would you like with this order? 

Would you like to BARN SIZE your order?  Yes:    No:       

Your Total Order comes to:    

PLEASE PAY BEFORE DRIVING AWAY!!!


 

contact Jeff Gullion for any questions or problems: jhgullion@dmacc.cc.ia.us