PROBLEM TO SOLVE: Given a specified “distance” from the golden ratio, determine
ID: 3836100 • Letter: P
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. 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 form’s 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.Explanation / Answer
±hen, I pronounced what sort o² information o² every variable I will utilize is. I pronounced all o² the fbs 1-3
also, the number o² fbs as "whole number" on the grounds that these numbers will dependably remain as entire numbers,
no decimals. I additionally announced "twofold" to client enter, the raTo (amongst fb2 and 3) and furthermore the
di³erence between the brilliant and fb raTos on the grounds that all these will contain a decimal place. ±o
demonstrate the aggregate I announced it as a "string" variable since it will then contain any set o²
characters I dole out it as well. ±o have the circle know when to stop and rehash I announced 'ag as a"
Boolean" expression.
Gather User InpuT
What I will be collecTng is whatever gets inpuµed into the textbox alongside "How near the
Brilliant RaTo should we get?" which then gets appointed as a "twofold" factor into the post box
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.