We will be using the Hackety Hack environment (hacketyhack.net) for this, which is an easy to install Ruby environment for Windows. If you run Mac OS X or Linux at home, you can develop Ruby programs by creating them in a text file, saving them with the extension .rb and running them with:
ruby myprog.rb
year=gets
| Year | No. of downloads |
|---|---|
| 2003 | 50000 |
| 2004 | 100000 |
| 2005 | 200000 |
| 2006 | 500000 |
| 2007 | 900000 |
| 2008 | 1900000 |
Chemical Brothers, Galvanize, chart 3, year 2005 Snow Patrol, Run, chart 4, year 2004 Electronic, Getting Away With It, chart 12, year 1989 Genesis, Turn It On Again, chart 8, year 1980 The X-Factor Winner, I Am The Greatest Ever, chart 1, year 2020
| Name | Room number |
|---|---|
| Bob Backhouse | RM801 |
| Mark Cranshaw | RM802 |
| Sandra Revell | RM803 |
| John Flackett | RM804 |
name=getsThe variable 'name' will then contain the text read in.
Lisa 90 James 20 Michelle 70 Craig 80 Harry 60 Tom 30Create a standalone method (outside of any class) called select_passed. This should take a parameter representing a hash, as above, and should loop through the hash. When a person with a mark of 40 or more is encountered, call yield and pass in the person's name.