Integers - an array from 0 to 100:
(0..100).to_a
Objectives:
- return all odd numbers
- return all even numbers
- return the square of all the numbers
- return the first number whose square is > 350
- return all the numbers whose square is > 350
- return all the numbers, cubed
- return the first number whose cube is > 500
- return all the numbers whose cube is < 500
For reference:
x ** 2
is x squaredx ** 3
is x cubedx.odd?
checks if x is oddx.even?
checks if x is even
Characters - array from 'a' to 'z' - ('a'..'z').to_a
Objectives:
- return all the letters, capitalized
- first letter with ord > 120
- all the letters whose capital is > 72
- all letters where the capital has an even ord
- all letters with odd ord
- first odd - ord letter with ascii value > 80
For reference:
letter.ord
- returns the ascii value of a letter