You are on page 1of 18

------------------------------------------------------------------EJERCICIO 01 Public Class Form1 Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.

Click Dim sol, ceu, r, dosdec As Double Dim ceu1 As Integer sol = InputBox("Ingrese Valor en Soles") ceu = sol / 3.51 r = ceu * 100 ceu1 = r dosdec = ceu1 / 100 TextBox1.Text = "Su valor en Euros es " & dosdec End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim eu, csol, r, dosdec As Double Dim csol1 As Integer eu = InputBox("Ingrese Valor en Euros") csol = eu * 3.51 r = csol * 100 csol1 = r dosdec = csol1 / 100

TextBox2.Text = "Su valor en Soles es " & dosdec End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = " " TextBox2.Text = " " Button1.Focus() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Close() End Sub End Class -------------------------------------------------------------------------------------------------------------------------------------------------EJERCICIO 02 Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim num As Integer Dim carac As String carac = InputBox("Ingrese Caracter para determinar su Valor ASCII") num = Asc(carac) TextBox1.Text = "El caracter es: " & carac & " y su codigo ASCII es: " & num

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" Button1.Focus() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Close() End Sub End Class ---------------------------------------------------------------------------------------------------------------------------------------------------EJERCICIO 03 Public Class Form1

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = " " TextBox2.Text = " " Button1.Focus() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Close() End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim c, f, r, dosdec As Double Dim f1 As Integer c = InputBox("Ingrese temperatura en Grados Celsius") f = (9 / 5) * c + 32 r = f * 100 f1 = r dosdec = f1 / 100 TextBox1.Text = dosdec End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim c, f, r, dosdec As Double Dim c1 As Integer f = InputBox("Ingrese temperatura en Grados Fahrenheit") c = 5 * ((f - 32) / 9) r = c * 100 c1 = r dosdec = c1 / 100 TextBox2.Text = dosdec End Sub

End Class --------------------------------------------------------------------------------------------------------------------------------------------------EJERCICIO 04 Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim l, a, r As Double Const pi = 3.1416 r = InputBox("Ingrese Radio") l = 2 * pi * r TextBox1.Text = "La longitud de la circunferencia es: " & l & vbCrLf a = pi * r ^ 2 TextBox1.Text = TextBox1.Text & "y su area es: " & a End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" Button1.Focus() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Close() End Sub

End Class --------------------------------------------------------------------------------------------------------------------------------------------------EJERCICIO 05 Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim m1, m2, r, f As Double Const g = 6.67 * 10 ^ (-11) m1 = InputBox("Ingrese masa M1") m2 = InputBox("Ingrese masa M2") r = InputBox("Ingrese distancia en metros") f = g * ((m1 * m2) / r ^ 2) If r <= 0 Then MsgBox("la distancia debe de ser mayor a cero") Else If m1 < 0 Then MsgBox("la masa M1 debe de ser mayor o igual a cero") Else If m2 < 0 Then MsgBox("la masa M2 debe de ser mayor o igual a cero") Else TextBox1.Text = f & " Nw^2" End If End If

End If End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" Button1.Focus() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Close() End Sub End Class --------------------------------------------------------------------------------------------------------------------------------------------------EJERCICIO 06 Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim aa, ep, aps, at As Integer aa = InputBox("Ingrese ao actual") ep = InputBox("Ingrese edad de la persona") aps = 2010 - aa at = ep + aps If at < ep Then

TextBox1.Text = "era de: " & at Else If at > ep Then TextBox1.Text = "va a ser de: " & at Else TextBox1.Text = "es de: " & at End If End If End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" Button1.Focus() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Close() End Sub End Class --------------------------------------------------------------------------------------------------------------------------------------------------EJERCICIO 07 Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim n, bd, bc, bm, mq, mc, mv, mcin, mu As Double n = InputBox("Ingrese Cantidad") If n < 2147483647 Then TextBox1.Text = TextBox1.Text & "El valor Ingresado es: " & n & vbCrLf If n >= 10000 Then bd = n \ 10000 n = n Mod 10000 End If If n >= 5000 Then bc = n \ 5000 n = n Mod 5000 End If If n >= 1000 Then bm = n \ 1000 n = n Mod 1000 End If If n >= 500 Then mq = n \ 500 n = n Mod 500 End If If n >= 100 Then mc = n \ 100 n = n Mod 100 End If

If n >= 25 Then mv = n \ 25 n = n Mod 25 End If If n >= 5 Then mcin = n \ 5 n = n Mod 5 End If If n >= 1 Then mu = n End If TextBox1.Text = TextBox1.Text & "Hay " & bd & " billetes de 10000" & vbCrLf TextBox1.Text = TextBox1.Text & "Hay " & bc & " billetes de 5000" & vbCrLf TextBox1.Text = TextBox1.Text & "Hay " & bm & " billetes de 1000" & vbCrLf TextBox1.Text = TextBox1.Text & "Hay " & mq & " monedas de 500" & vbCrLf TextBox1.Text = TextBox1.Text & "Hay " & mc & " monedas de 100" & vbCrLf TextBox1.Text = TextBox1.Text & "Hay " & mv & " monedas de 25" & vbCrLf TextBox1.Text = TextBox1.Text & "Hay " & mcin & " monedas de 5" & vbCrLf TextBox1.Text = TextBox1.Text & "Hay " & mu & " monedas de 1" & vbCrLf Else MsgBox("El valor es muy grande debe ser menor a 2147483647") End If End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Close() End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" Button1.Focus() End Sub End Class. --------------------------------------------------------------------------------------------------------------------------------------------------EJERCICIO 08 Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim num, tm, c, num1, res, com, z, z1 As Double Dim r, k, tm1 As Integer c=1 num = InputBox("ingrese numero") k = num num1 = num * 100 r = num1 res = r / 100 com = (res - k) z = r Mod 10 z1 = r \ 10

If com = 0 Then TextBox1.Text = TextBox1.Text & "TABLA DE MULTIPLICAR DEL NUMERO " & res & ".00" & vbCrLf While c <= 10 tm = res * c TextBox1.Text = TextBox1.Text & res & ".00 * " & c & " = c=c+1 End While Else If z = 0 Then z1 = z1 Mod 10 TextBox1.Text = TextBox1.Text & "TABLA DE MULTIPLICAR DEL NUMERO " & res & vbCrLf While c <= 10 tm = res * c tm1 = tm If c <> 1 And c <> 10 Then If ((z1 = 2 And c = 5) Or (z1 = 4 And c = 5) Or (z1 = 5 And c = 2) Or (z1 = 5 And c = 4) Or (z1 = 5 And c = 6) Or (z1 = 5 And c = 8) Or (z1 = 6 And c = 5) Or (z1 = 8 And c = 5)) Then TextBox1.Text = TextBox1.Text & res & "0 * " & c & " = vbCrLf Else TextBox1.Text = TextBox1.Text & res & "0 * " & c & " = End If Else If c = 1 Then TextBox1.Text = TextBox1.Text & res & "0 * " & c & " = Else " & tm & "0" & vbCrLf " & tm & "0" & vbCrLf " & tm & ".00" & " & tm & ".00" & vbCrLf

If c = 10 Then TextBox1.Text = TextBox1.Text & res & "0 * " & c & " = vbCrLf End If End If End If c=c+1 End While Else TextBox1.Text = TextBox1.Text & "TABLA DE MULTIPLICAR DEL NUMERO " & res & vbCrLf While c <= 10 tm = res * c If c <> 10 Then If ((z = 2 And c = 5) Or (z = 4 And c = 5) Or (z = 5 And c = 2) Or (z = 5 And c = 4) Or (z = 5 And c = 6) Or (z = 5 And c = 8) Or (z = 6 And c = 5) Or (z = 8 And c = 5)) Then TextBox1.Text = TextBox1.Text & res & " * " & c & " = Else TextBox1.Text = TextBox1.Text & res & " * " & c & " = End If Else TextBox1.Text = TextBox1.Text & res & " * " & c & " = End If c=c+1 End While End If End If " & tm & "0" & vbCrLf " & tm & "" & vbCrLf " & tm & "0" & vbCrLf " & tm & ".00" &

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" Button1.Focus() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Close() End Sub End Class --------------------------------------------------------------------------------------------------------------------------------------------------EJERCICIO 09 Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim n, c, cub, cua, l As Integer n = InputBox("Ingrese numero") l=n+5 n=n+1 TextBox1.Text = TextBox1.Text & "Numero While n <= l cua = n * n " & "Cuadrado " & "Cubo" & vbCrLf

cub = n * n * n TextBox1.Text = TextBox1.Text & " n=n+1 End While End Sub "&n&" " & cua & " " & cub & vbCrLf

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox1.Text = "" Button1.Focus() End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Close() End Sub End Class --------------------------------------------------------------------------------------------------------------------------------------------------EJERCICIO 10 Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim na, cp, ppu, pt As Double Dim tp As String na = InputBox("Numero de almacen")

tp = InputBox("Tipo de pieza") cp = InputBox("Cantidad a pedir de la determinada pieza") ppu = InputBox("Precio por unidad") pt = cp * ppu TextBox1.Text = TextBox1.Text & "El numero de almacen es: " & na & vbCrLf TextBox1.Text = TextBox1.Text & "El tipo de pieza es: " & tp & vbCrLf TextBox1.Text = TextBox1.Text & "Cantidad pedida por pieza es: " & cp & vbCrLf TextBox1.Text = TextBox1.Text & "Precio por unidad de determinada pieza es: " & ppu & vbCrLf TextBox1.Text = TextBox1.Text & "El importe total de pedido a pagar es: " & pt & vbCrLf End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" Button1.Focus() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Application.Exit() End Sub End Class --------------------------------------------------------------------------------------------------------------------------------------------------EJERCICIO 11 Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim num, grad, min, seg, k, m As Double Dim k1 As Integer num = InputBox("Ingrese valor en radianes") k = num m=1 Do k = k * 10 m = m * 10 k1 = k Loop While ((k - k1) <> 0) grad = (k * 180) \ m min = (((k * 180) Mod m) * 60) \ m seg = (((((k * 180) Mod m) * 60) Mod m) * 60) \ m TextBox1.Text = grad & "" & min & "'" & seg & "''" End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" Button1.Focus() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Close() End Sub End Class ---------------------------------------------------------------------------------------------------------------------------------------------------------

You might also like