title: calculate fibonacci sequence position from user inserted value
body: <p>Below is my full program's code:</p>
  
  <pre><code>GradeAvg = [[59, 'F'], [69, 'D'], [79, 'C'], [89, 'B'], [100, 'A']]
  
  def letter_grade
    num = number_grade
    _, letter = GradeAvg.find { |n, _| num &lt;= n }
    [num, letter]
  end
  
  def number_grade
    loop do
      puts 'Please insert a number between 1 and 100.'
      num = gets.to_i
      break(num) if (1..100).cover?(num)
    end
  end
  
  def fib(n)
    return n if n &lt; 2
  
    fib(n-1) + fib(n-2)
  end
  
  10.times { print letter_grade; (num).each { |n| puts fib(n) }; puts }
  </code></pre>
  
  <p>It is failing with the below error:</p>
  
  <pre><code>undefined local variable or method `num' for main:Object (NameError)
  </code></pre>
  
  <p>Why can't I apply my fibonacci sequence calculation on my acceptable user inserted value in variable <code>num</code>?</p>