0% found this document useful (0 votes)
43 views6 pages

Aplicaciones de Cálculo en VB.NET

This document contains code for several Visual Basic .NET programs to perform basic calculations and conversions, including: 1) Converting between soles, dollars, and euros. 2) Converting seconds to hours, minutes, and seconds. 3) Determining if a number is even or odd. 4) Ordering three different input numbers from greatest to least. 5) A basic calculator program that can add, subtract, multiply and divide two numbers. The code declares variables, gets user input, performs calculations, and outputs results to text boxes with buttons to start calculations, clear fields, and exit. Instructions are provided in Spanish for a 5th grade computing class assignment to design a payroll

Uploaded by

DIABOLID
Copyright
© Attribution Non-Commercial (BY-NC)
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
0% found this document useful (0 votes)
43 views6 pages

Aplicaciones de Cálculo en VB.NET

This document contains code for several Visual Basic .NET programs to perform basic calculations and conversions, including: 1) Converting between soles, dollars, and euros. 2) Converting seconds to hours, minutes, and seconds. 3) Determining if a number is even or odd. 4) Ordering three different input numbers from greatest to least. 5) A basic calculator program that can add, subtract, multiply and divide two numbers. The code declares variables, gets user input, performs calculations, and outputs results to text boxes with buttons to start calculations, clear fields, and exit. Instructions are provided in Spanish for a 5th grade computing class assignment to design a payroll

Uploaded by

DIABOLID
Copyright
© Attribution Non-Commercial (BY-NC)
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

I.E.P.

MENTOR SCHOOLS
CONVERSION DE SOLES A DOLARES Y EUROS Public Class Form1 Private Sub BTNCALCSOLES_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNCALCSOLES.Click 'Declaracion de variables Dim s, d, x, soles, dolares As Double Dim vdolares, veuros As Double vdolares = 2.73 veuros = 3.57 soles = Val(TXTSOLES.Text) 'calcular d = soles / vdolares x = soles / veuros 'salida TXTDOLARES.Text = d.ToString TXTEUROS.Text = x.ToString End Sub

5to secundaria

Private Sub BTNNEWSOLES_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNNEWSOLES.Click TXTSOLES.Text = "" TXTDOLARES.Text = "" TXTEUROS.Text = "" TXTSOLES.Focus() End Sub Private Sub BTNCALCDOLARES_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNCALCDOLARES.Click 'declaracion de variables Dim s, d, x, dolares As Double Dim vdolares, veuros As Double vdolares = 2.73 veuros = 3.57 dolares = Val(TXTDOLARES1.Text) 'calcular s = dolares * vdolares x = s / veuros 'salida TXTSOLES1.Text = s.ToString TXTEUROS1.Text = x.ToString

Computacin e Informtica---------Prof. Carlos Ucaay

I.E.P. MENTOR SCHOOLS


End Sub

5to secundaria

Private Sub BTNNEWDOLARES_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNNEWDOLARES.Click TXTDOLARES1.Text = "" TXTSOLES1.Text = "" TXTEUROS1.Text = "" TXTDOLARES1.Focus() End Sub Private Sub BTNSALIR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNSALIR.Click End End Sub End Class

CONVERTIR SEGUNDOS A HORAS, MINUTOS Y SEGUNDOS Public Class Form1 Private Sub BTNCONVERT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNCONVERT.Click Dim T, H, M, S As Long Dim HORA As Long = 3600 Dim MINUTO As Long = 60 T = Val(TXTTIEMPO.Text) H = T \ HORA T = T Mod HORA M = T \ MINUTO S = T Mod MINUTO TXTHORA.Text = H.ToString TXTMINUTO.Text = M.ToString TXTSEGUNDO.Text = S.ToString End Sub Private Sub BTNNEW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNNEW.Click TXTTIEMPO.Text = "" TXTHORA.Text = "" TXTMINUTO.Text = "" TXTSEGUNDO.Text = "" TXTTIEMPO.Focus() End Sub

Computacin e Informtica---------Prof. Carlos Ucaay

I.E.P. MENTOR SCHOOLS

5to secundaria

Private Sub BTNSALIR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNSALIR.Click End End Sub End Class PAR E IMPAR Public Class Form1 Private Sub BTNCALC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNCALC.Click Dim A As Integer A = Val(TXTNUM.Text) If A Mod 2 = 0 Then TXTCONDI.Text = "PAR" Else TXTCONDI.Text = "IMPAR" End If End Sub Private Sub BTNNEW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNNEW.Click TXTCONDI.Text = "" TXTNUM.Text = "" TXTNUM.Focus() End Sub Private Sub BTNSALIR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNSALIR.Click End End Sub End Class ORDENACION DE 3 NUMEROS DIFERENTES Public Class Form1 Private Sub BTNCALC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNORDEN.Click Dim A, B, C As Integer A = Val(TXTA.Text) B = Val(TXTB.Text) C = Val(TXTC.Text)

Computacin e Informtica---------Prof. Carlos Ucaay

I.E.P. MENTOR SCHOOLS


If A > B Then If A > C Then If B > C Then TXTMAYOR.Text = A TXTMEDIO.Text = B TXTMENOR.Text = C Else TXTMAYOR.Text = A TXTMEDIO.Text = C TXTMENOR.Text = B End If Else TXTMAYOR.Text = C TXTMEDIO.Text = A TXTMENOR.Text = B End If Else If B > C Then If C > A Then TXTMAYOR.Text = B TXTMEDIO.Text = C TXTMENOR.Text = A Else TXTMAYOR.Text = B TXTMEDIO.Text = A TXTMENOR.Text = C End If Else TXTMAYOR.Text = C TXTMEDIO.Text = B TXTMENOR.Text = A End If End If End Sub

5to secundaria

Private Sub BTNNEW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNNEW.Click TXTA.Text = "" TXTB.Text = "" TXTC.Text = "" TXTMAYOR.Text = "" TXTMEDIO.Text = "" TXTMENOR.Text = "" End Sub Private Sub BTNSALIR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNSALIR.Click End

Computacin e Informtica---------Prof. Carlos Ucaay

I.E.P. MENTOR SCHOOLS


End Sub End Class LA CALCULADORA Public Class Form1 Private Sub BTNIGUAL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNIGUAL.Click Dim NUM1, NUM2, RPTA As Double Dim OP As String NUM1 = Val(TXTNUM1.Text) NUM2 = Val(TXTNUM2.Text) OP = TXTOPERADOR.Text Select Case OP Case "+" RPTA = NUM1 + NUM2 Case "-" RPTA = NUM1 - NUM2 Case "*" RPTA = NUM1 * NUM2 Case "/" If NUM2 <> 0 Then RPTA = NUM1 / NUM2 Else RPTA = 0 End If End Select TXTRESULTADO.Text = RPTA End Sub

5to secundaria

Private Sub BTNNUEVO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNNUEVO.Click TXTNUM1.Text = "" TXTNUM2.Text = "" TXTOPERADOR.Text = "" TXTRESULTADO.Text = "" TXTNUM1.Focus() End Sub Private Sub BTNSALIR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNSALIR.Click End End Sub End Class

Computacin e Informtica---------Prof. Carlos Ucaay

I.E.P. MENTOR SCHOOLS

5to secundaria

TAREA: Ahora disea la siguiente aplicacion y programala para que funcione


PLANILLA DE PAGOS

Computacin e Informtica---------Prof. Carlos Ucaay

You might also like