Wednesday, April 29, 2009

Project 2 Discussion

Randy's DonutsImage via Wikipedia

Re: the bonusDonuts() function as we discussed in class Wed.

1. When declaring a variable in a function, avoid using the name of the function itself for the variable name.

2. The function must return the number of bonus donuts.

function bonusDonuts(){
   //copy and paste lines 11..16 here

   //don't call this variable bonusDonuts
   var numBonusDonuts = . . .

   //return the number of bonus donuts
   return numBonusDonuts
}

Questions? Add a comment to this post. Anyone is welcome to post both questions and answers
Reblog this post [with Zemanta]

How to Subscribe to this Blog

If you have a question about a project, add a comment to the project post. Anyone in class with an answer may reply-- our own version of the wisdom of crowds and crowdsourcing.

You can subscribe to this blog's RSS feed by using Firefox's Live Bookmarks feature. Then all new posts will be "pushed" to your browser. Here's how to do it:

1. In Firefox choose Bookmarks > Organize Bookmarks, and create a "Feeds" folder on the bookmarks toolbar.

2. Open this blog in Firefox, scroll to the bottom and click on "Subscribe to: Posts (Atom)". A new page will open in the browser: select Live Bookmarks in the drop-down list, and click Subscribe Now. Add the bookmark to your Feeds folder. Presto!

The drawback to using Live Bookmarks is that the bookmarks exist only on the computer you used to subscribe. An alternative is to use a hosted feed reader such as Google Reader. Then your feeds are stored in the "cloud" and may be accessed from any machine by logging in to your Google account.

Reminder to use Google ReaderImage by Sue Waters via Flickr



Reblog this post [with Zemanta]