Time to tame the beast 😈

This quiz was another level. I found it difficult because of the Fibonacci series, but at the end I tamed the beast.

In this quiz we had to :

  1. Write a function called distance(x1, y1, x2, y2) which receives four numbers which
    represent two points in the cartesian plane. The function should return the distance
    between the two points (x1,y1) and (x2,y2). Remember that the square of the
    hypotenuse of a right angle triangle is equal to the sum of the squares of the two other sides.
  2. Write a function called fibonacci which receives a single parameter “n” (a non-negative integer) and returns the nth number in the fibonacci series which is:
    0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89…………
    So, fibonacci(0) would return 0.
    fibonacci(5) would return 5
    fibonacci(8) would return 21.
    Note that the first two fibonacci numbers are 0 and 1.
    All others are the sum of the previous two fibonacci numbers.

1288910_700b

             (Credits goes to http://9gag.com/gag/1288910)

 

This was me with the Fibonacci program, beacuase in my other course I used to have a lot of problems, but at the end  I tamed the beast. 🐯

The link to meet the beast 👉 https://github.com/mfcanov/Quiz-3.git

 

CC BY-SA 4.0 Time to tame the beast 😈 by fernandacano is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.