100% found this document useful (1 vote)
257 views6 pages

Visual .NET Object Calculations

This document contains code for several small programs that perform basic math operations and conversions. The programs include: dividing two numbers entered in text boxes and displaying the quotient and remainder, calculating the area and volume of a room given its dimensions, converting seconds entered into a text box to minutes and remaining seconds, and converting feet entered into a text box to yards, inches, centimeters and meters.

Uploaded by

ThaliaL.R.Klaus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
257 views6 pages

Visual .NET Object Calculations

This document contains code for several small programs that perform basic math operations and conversions. The programs include: dividing two numbers entered in text boxes and displaying the quotient and remainder, calculating the area and volume of a room given its dimensions, converting seconds entered into a text box to minutes and remaining seconds, and converting feet entered into a text box to yards, inches, centimeters and meters.

Uploaded by

ThaliaL.R.Klaus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

VISUAL NET

Public Class Form1


Private Sub Form1_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
End Sub
Private Sub Button1_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim a As Integer
Dim b As Integer
Dim cociente As Integer
Dim resto As Integer
a = Val([Link])
b = Val([Link])
cociente = a / b
resto = a Mod b
[Link] = cociente
[Link] = resto
End Sub
Private Sub Label1_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
End Sub
Private Sub Button2_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
End
End Sub

Private Sub Button3_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link]()
End Sub
Private Sub Label2_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
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 [Link], ByVal e As
[Link]) Handles [Link]
Dim lon As Integer
Dim ach As Integer
Dim alt As Integer
Dim area As Integer

Dim vol As Integer


lon = Val([Link])
ach = Val([Link])
alt = Val([Link])
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 [Link], ByVal e As
[Link]) Handles [Link]
Dim seg1 As Integer
Dim MinEnt As Integer
Dim seg2 As Integer
seg1 = Val([Link])
MinEnt = seg1 / 60

seg2 = seg1 Mod 60


MsgBox(MinEnt & "min " & seg2 & "segundos")
End Sub
Private Sub Label1_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
End Sub
Private Sub Button2_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = ""
[Link]()
End Sub
Private Sub Button3_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
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 [Link], ByVal e As


[Link]) Handles [Link]
pie = Val([Link])
yard = pie / 3
MsgBox(pie & "pies " & yard & "yardas")
End Sub
Private Sub Button2_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
End Sub
Private Sub Button3_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
pie = Val([Link])
cent = pie / 3.48
MsgBox(pie & "pies " & yard & "centimetros")

End Sub
Private Sub Button4_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
End Sub

Private Sub Button5_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]
End Sub
Private Sub Button6_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
End Sub
End Class

Supongamos que un automvil parte del reposo y tiene una aceleracin

You might also like