Quiz 3

Hey there, here is my quiz 3 results and solution, the instructions where the following ones:

  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).
  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.

Here I leave you a link to the quiz: QUIZ3

For the first one, here I leave you all the pictures:

Click to view slideshow.

You can get access to the code in the following link:

https://gist.github.com/batmantec/03e91eda0605eef62746

For the second one, it actually took more research, because I didn’t understand what is the sequence that the Fibonacci use, for it I consult a lot of websites, which I will list here.

http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/fib.html

https://en.wikipedia.org/wiki/Fibonacci_number

http://platonicrealms.com/encyclopedia/Fibonacci-sequence

At the end, It was really weird how I did manage to make it, but It did gave me the results I was hoping for.

Here I leave you some pictures of the code and the program running:

Click to view slideshow.

The link to the code is here:

https://gist.github.com/batmantec/3ab093f33ee801a6fbdf

CC BY-SA 4.0 Quiz 3 by batmantec is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.