Trabajo en clase de Módulo Case

Anuncio
Trabajo en clase de Módulo Case
Nombre: Pamela Buenaño
Menú en el que se pueden escoger las opciones de Factorial de un Número, Potencia de
un Número y Los N Fibonacci.
Public Class Form1
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button4.Click
End
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Form2.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Form3.Show()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
Form4.Show()
End Sub
End Class
Realizado Por: Pamela Buenaño
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
Dim n, i, f As Integer
n = TextBox1.Text
i=1
f=1
Do While (i <= n)
f=f*i
i=i+1
Loop
TextBox2.Text = f
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Form1.Show()
Me.Hide()
End Sub
End Class
Realizado Por: Pamela Buenaño
Public Class Form3
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Form1.Show()
Me.Hide()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
Dim a, ex, i, p As Integer
a = TextBox1.Text
ex = TextBox2.Text
i=1
p=1
Do While (i <= ex)
p=p*a
i=i+1
Loop
TextBox3.Text = p
End Sub
End Class
Realizado Por: Pamela Buenaño
Public Class Form4
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Form1.Show()
Me.Hide()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim a, b, c, i, n As Integer
n = TextBox1.Text
a=0
b=1
i=3
Do While i <= n
c=a+b
a=b
b=c
i=i+1
Loop
TextBox2.Text = c
End Sub
End Class
Realizado Por: Pamela Buenaño
Descargar