On this quiz I had to make two programs, one was a fibonacci calculator and the other one was a program that calculates the distace between two points in the cartesian plane. The difficult part on this program was (IN ALL PROGRAMS) to transform what I want to do to the program to the program […]
Program One This program asked us to take 2 points on the cartesian plane and print the distance in between those points. I used the formula for distance for two points which is: And this was the result Here’s the source code. Program Two For this program, we had to make the Fibonacci series for […]
Program One This program asked us to take 2 points on the cartesian plane and print the distance in between those points. I used the formula for distance for two points which is: And this was the result Here’s the source code. Program Two For this program, we had to make the Fibonacci series for […]
Quiz 7I got confused about the mathematic function of how Fibonacci works, so that was my biggest problem. Palindrome was easier.Here are my codes:FibonacciPalindrome
Here’s the quiz # 7 Distance: https://github.com/JsphSalazar/Quiz07/blob/master/distance Fibonacci: https://github.com/JsphSalazar/Quiz07/blob/master/Fibonacci
Here’s the quiz # 7 Distance: https://github.com/JsphSalazar/Quiz07/blob/master/distance Fibonacci: https://github.com/JsphSalazar/Quiz07/blob/master/Fibonacci
Here are the answers of my quiz #07. Question 1 #include <iostream> using namespace std; long fibonacci(long x){ long y=0, z=1, w=0; while (x>1) { w=y+z; y=z; z=w; x=x-1; } return w; } int main() { long x; cout << “Introduce un número”<< endl; cin >> x; if (x==1) { int w=1; cout << “De […]
This is my code!
Here are the answers of my quiz #07. Question 1 #include <iostream> using namespace std; long fibonacci(long x){ long y=0, z=1, w=0; while (x>1) { w=y+z; y=z; z=w; x=x-1; } return w; } int main() { long x; cout << “Introduce un número”<< endl; cin >> x; if (x==1) { int w=1; cout << “De […]
Write a function called fibonacci which receives a lon “n” and returns a long which is the value of the nth number in the fibonacci series which is: 0,1,1,2,3,5,8,13,21,34,55,89………. So, fibonacci(0) woud 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 … Continue reading #Quiz07 →