VISUAL NET
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim a As Integer
Dim b As Integer
Dim cociente As Integer
Dim resto As Integer
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
cociente = a / b
resto = a Mod b
Label4.Text = cociente
Label5.Text = resto
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label1.Click
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
Label4.Text = ""
Label5.Text = ""
TextBox1.Focus()
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label2.Click
End Sub
End Class
-x-
Longitud, ancho y altura de una habitacin y a continuaciobn muestre el volumen de la
habitacin mediante un mensaje.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim lon As Integer
Dim ach As Integer
Dim alt As Integer
Dim area As Integer
Dim vol As Integer
lon = Val(TextBox1.Text)
ach = Val(TextBox2.Text)
alt = Val(TextBox3.Text)
area = lon * ach
vol = area * alt
MsgBox("El area es: " & area & Chr(13) & "El volumen es " & vol)
End Sub
End Class
-x-
INGRESAR UN VALOR EN SEGUNDOS Y NOS MUESTRE EN MINUTOS Y SU DIFERENCIA EN
SEGUNDOS
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim seg1 As Integer
Dim MinEnt As Integer
Dim seg2 As Integer
seg1 = Val(TextBox1.Text)
MinEnt = seg1 / 60
seg2 = seg1 Mod 60
MsgBox(MinEnt & "min " & seg2 & "segundos")
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label1.Click
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox1.Focus()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
End
End Sub
End Class
-x-
ESCRIBIR UN PROGRAMA PARA CONVERTIR UNA MEDIDA EN PIE DADA EN PIES SUS
EQUIVALENCIAS
YARDAS PULGADAS CENTIMETROS METROS
UN PIE = 12 PULGADAS
1 YARDA = 3 PIES
1 PULGADA = 2.45 CM
1METRO = 100 CM
LEER EL NUMERO DE PIES ENSEGUIDA DE MOSTRAR EL NUMERO DE YARDAS, PIES, PULGADAS,
CENTIMETROS Y METROS
Public Class Form1
Dim
Dim
Dim
Dim
Dim
pie As Integer
yard As Double
pulg As Integer
cent As Integer
met As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
pie = Val(TextBox1.Text)
yard = pie / 3
MsgBox(pie & "pies " & yard & "yardas")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
pie = Val(TextBox1.Text)
cent = pie / 3.48
MsgBox(pie & "pies " & yard & "centimetros")
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button6.Click
End Sub
End Class
Supongamos que un automvil parte del reposo y tiene una aceleracin