Arrays Exercise

In case you get stuck anywhere, don't be afraid to ask the coaches! They are here to help and will gladly explain everything to you!

Take notes during the exercises. Even if you never look at them again, they will help you memorise things!

  1. Write a program that lets the user input 3 strings. Save those strings in an array. Then print the first letter of each of the strings.

  2. Find out how to do each of these things with an array (by googling or looking it up in the Ruby documentation) and try each of these in IRB.
    1. delete all elements in the array
    2. turn the order of the elements in the array around
    3. sort the array
    4. randomise the order of the elements in the array
    5. delete duplicate entries from the array
  3. What’s the difference between array methods with or without exclamation mark? For example shuffle​ vs. ​shuffle!​ To figure this one out, try assigning the return value of the methods to a variable.