0% found this document useful (0 votes)
24 views

Practica Numero 1 Ejerciocio Numero 1

The document describes a program with 7 buttons that perform basic math operations. Button 1 adds values from two text boxes. Button 2 subtracts values. Button 3 multiplies values. Button 4 divides values and checks for division by zero. Button 5 squares a value. Button 6 cubes a value. Button 7 closes the program with a goodbye message. The program takes numeric input from text boxes and displays results in a label.

Uploaded by

Diiana Ramirezz
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)
24 views

Practica Numero 1 Ejerciocio Numero 1

The document describes a program with 7 buttons that perform basic math operations. Button 1 adds values from two text boxes. Button 2 subtracts values. Button 3 multiplies values. Button 4 divides values and checks for division by zero. Button 5 squares a value. Button 6 cubes a value. Button 7 closes the program with a goodbye message. The program takes numeric input from text boxes and displays results in a label.

Uploaded by

Diiana Ramirezz
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
You are on page 1/ 5

Practica numero 1 Ejerciocio numero 1

Cdigo de todos los botones


Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click REM: Este es el problema 1 de la practica numero 1 y se realizo el 11/11/13 REM :Suma Dim a, b, sum As Integer a = Val(TextBox1.Text) b = Val(TextBox2.Text) sum = a + b Label4.Text = Str(sum) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click REM : Resta Dim a, b, res As Integer a = Val(TextBox1.Text) b = Val(TextBox2.Text) res = a - b Label4.Text = Str(res) End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click REM : Multiplicacion Dim a, b, mul As Integer a = Val(TextBox1.Text) b = Val(TextBox2.Text) mul = a * b Label4.Text = Str(mul) End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click REM : Division Dim a, b, div As Single a = Val(TextBox1.Text) b = Val(TextBox2.Text) If b = 0 Then MsgBox("No puedo dividir entre Cero") Else div = a / b Label4.Text = Str(div) End If End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click REM : Cuadrado Dim a, cuadrado As Integer a = Val(TextBox1.Text) cuadrado = a * a Label4.Text = Str(cuadrado) End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click REM : El cubo Dim a, cubo As Integer a = Val(TextBox1.Text) cubo = (a * a) * a Label4.Text = Str(cubo) End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click MsgBox("Hasta pronto") Close() End Sub

Programa ejecutando

You might also like