Goal:
How to make Fibonacci Program
Material:
Laptop/computer, Visual Basic programming language
Assalamualaikm wr wb
Introduce
my name Intan Fadzilatunnisa, now I will explain how to create a Fibonacci
program using Visual Basic programming language. Previously I tell you what
Fibonacci numbers. Fibonacci is a simple sequence number starts at 0 and 1 and
the next digit is the sum of the previous two numbers. For example: 1 1 2 3 5 8
13 21. . . . . etc.
The
first course, we need a Visual Basic program that had previously been installed
on your laptop or computer. Ok on with it.
Step:
1. Click
the start menu. All programs select Microsoft Visual Basic.
2. Create
first appearance initially.
Explanation: 3 Label (series1, series2, series3), 3
Textbox (to fill the series1, series2, series3), 2 command buttons (Process and
finish), 1 listbox (to display the results).
3. Double
click on the process, go to the code. Enter the code as shown below:
Private Sub Command1_Click()
Dim a, b, c, n As Integer
a = Text1.Text
b = Text2.Text
n = Text3.Text
Fibonacci.AddItem a
Fibonacci.AddItem b
For i = 3 To n
c = Val(a) + Val(b)
Fibonacci.AddItem c
a = b
b = c
Next i
End Sub
4. Double
click the finish button, go to the code earlier. Enter the code below:
Private Sub Command2_Click()
End
End Sub
5. The
final step, run the program using the F5 key, enter a number into the dialog
box, then click process.