Question
PROBLEM TO SOLVE: Given a specified distance from the golden ratio, determine how many Fibonacci numbers must be generated in order to get this close.
PROBLEM TO SOLVE: Given a specified distance from the golden ratio, determine how many Fibonacci numbers must be generated in order to get this close. Note that there are no units involved; the distance isthe absolute value of the difference between two numbers of data type Double. To do this you will need to implement a loop. First complete Lab8. After completing Lab8, make a Project3 folder in your CS account; copy the completed Lab8 program into your Project3 folder. Recall that the project was named GoldenRatio. The source code file was named GoldenRatio.vb. Now make the changes needed to convert the Lab8 program to the program to solve the Project3 problem. Here are a few hints to help you get started:
1. Change the Text property of the forms labels to match what is seen in the sample output at the end of this document.
2. For this project you need to declare only one constant: 3 Const GOLDEN_RATIO As Double = 1.6180339887
3. The difference between the current ratio of the last two fibs and the golden ratio must be unsigned. To do this use the absolute value function as follows: diff = Math.Abs(GOLDEN_RATIO - ratio)
4. After exiting the loop, display the fib numbers generated in the Text property of the resultTxt TextBox.
5. To determine how many Fibonacci numbers were generated you can set up a loop counter; we called this numFibs in the Lab8 program.
6. Grading rubric available on Canvas in the Project 3 assignment.
7. The following are Sample Outputs:
0.5 How close to the Golden Ratio should we get? Calculate Fibonacci Numbers generated 0, 1, 1, 2 It required calculating Fibonacci numbers to get this close to the Golden Ratio
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started