Skip to content

Instantly share code, notes, and snippets.

@alexdunae
Created January 21, 2015 20:29
Show Gist options
  • Save alexdunae/351e969bf79294210c75 to your computer and use it in GitHub Desktop.
Save alexdunae/351e969bf79294210c75 to your computer and use it in GitHub Desktop.
Week 3 Quiz

Week 3 Quiz

Submit your answers to me by email: alex@dunae.ca

  • What are two ways to create an array?
  • What are two ways to create a hash?
  • Write code to find the number of elements in an array.
  • Write code to show how to access the value of key in a hash.
  • Write code to find the number of keys in a hash.
  • What does the @ sign mean before a variable name in a class?
  • What is the difference between attr_reader and attr_accessor? Why would we want them?
  • How would you check if an array is empty?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment