Question: C# Please Concept Summary: 1. Object Oriented programming concepts 2. Interfaces Objective: In this lab you will compute Fibonacci numbers using two different classes, each

Concept Summary: 1. Object Oriented programming concepts 2. Interfaces Objective: In this lab you will compute Fibonacci numbers using two different classes, each of which implements the same FindFib interface. Fibonacci is an interesting sequence. The first fibonacci number is 1. The second is 1, every subsequent number is the sum of the previous 2. To put it in math terms: F(n)=F(-1) + F(1-2). The sequence looks like: 1.1.2.3,5,8,13, 2134, 55... Hence Fibonacci(10) is 55. Fibonacci(6) = 8 etc. Assignment Requirements: Begin by creating an interface FindFib. It should have one method calculate_fibo. o calculate_lib() should take in an integer, and should return an integer. Next, create a class Fiblteration that implements FindFib. calculate_fibo) should take in the same parameters and return the same type as the interface version To calculate Fibonacci iteratively you start by checking if you are being asked to culculate the Fibonacci of 1 of 2, if so you retum 1. Otherwise, you'll use a loop to keep adding up the previous numbers until you arrive at the answer Next, create a class FibFormula that implements FindFib. calculate_fib() should take in the same parameters and return the same type as the interface version To calculate Fibonacci by formula, plug in to Binet's Formula - F(n) =((+sqrt(5))/2)^n - ((1-sqrt(59)/2)^n) / sqrt(5) Create a driver program which prompts the user to enter a number, then calculate the fibonacci using both methods, and print the results Create UML diagrams of the interface, 2 classes and driver program. Submit as a PDF along with the code Sample Output: Enter the number you want to find the Fibonacci Series for: 10 Fib of 10 by iteration is: 55 Fib of 10 by formula is: 55
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
