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!
Write a small program that asks for a number and it prints out “Hello!” to the user as many times as the number that was entered.
Create an array with 5 numbers and multiply each numbers with 2 and return the result for each number in a new array.
Here is an array with some names:
names = ["John", "Angus", "Jane", "Hannibal"]
Write some code to get all names which start with the letter
J. The result should be stored in a new array.
We have the following method:
def mystery(numbers) numbers.select do |number| number % 3 == 0 end end
What does the method
mysteryreturn if we call it with…
mystery([1, 5, 9, 11, 18])
Write a method which takes an array of numbers as argument and returns the first number that can be divided by 5