martes, 25 de junio de 2019

Ejercicios Segunda Parte

ÁREA CUADRADO
Module Ejercicio4

    Sub Main()

        Console.WriteLine("Escribe el valor de un radio")
        Dim radio As Double = Console.ReadLine()

        Dim area As Double = Math.PI * Math.Pow(radio, 2)

        Console.WriteLine("El area es " & area)

        Console.ReadLine()

    End Sub

End Module

BUCLE

Module Ejercicio7

    Sub Main()

        For i As Integer = 0 To 100

            If i Mod 2 <> 0 Then
                Console.WriteLine(i)
            End If

        Next

        Console.ReadLine()

    End Sub

End Module


CALCULO DEL IVA

Module Ejercicio2

    Sub Main()

        Const IVA As Double = 0.21

        Console.WriteLine("Escribe el valor de un producto")
        Dim producto As Double = Console.ReadLine

        Console.WriteLine("El IVA del producto es " & producto * IVA & " euros. El valor final es " & producto + (producto * IVA) & " euros")

        Console.ReadLine()

    End Sub

End Module



CREAR NÚMERO ALEATORIO

Module Module1

    Sub Main()

        Dim numeroAleatorio As Integer = numAleatorioEntre(1, 10)

        Console.WriteLine("El numero generado es: " & numeroAleatorio)


        Console.ReadLine()

    End Sub

    Function numAleatorioEntre(ByVal minimo As Integer, ByVal maximo As Integer) As Integer
        Randomize()
        Return CLng((minimo - maximo) * Rnd() + maximo)
    End Function

End Module


GENERA 10 NÚMEROS ALEATORIOS

Module Module1

    Sub Main()

        Dim numeroAleatorio As Integer

        For i = 1 To 10

            numeroAleatorio = numAleatorioEntre(1, 10)

            Console.WriteLine("El numero generado es: " & numeroAleatorio)

        Next



        Console.ReadLine()

    End Sub

    Function numAleatorioEntre(ByVal minimo As Integer, ByVal maximo As Integer) As Integer
        Randomize()
        Return CLng((minimo - maximo) * Rnd() + maximo)
    End Function

End Module



MUESTRA NÚMEROS DEL 0 AL 100

Module Ejercicio6

    Sub Main()

        Dim i As Integer = 0

        While i <= 100

            If i Mod 2 <> 0 Then
                Console.WriteLine(i)
            End If

            i = i + 1

        End While

        Console.ReadLine()

    End Sub

End Module



PIDE 2 NÚMEROS POR TECLADO

Module Ejercicio5

    Sub Main()

        Console.WriteLine("Escribe el valor del primer numero")
        Dim num1 As Integer = Console.ReadLine()

        Console.WriteLine("Escribe el valor del segundo numero")
        Dim num2 As Integer = Console.ReadLine()

        If num1 Mod num2 = 0 Then
            Console.WriteLine("El número " & num1 & " es divisible por " & num2)
        Else
            Console.WriteLine("El número " & num1 & " no es divisible por " & num2)
        End If

        Console.ReadLine()

    End Sub

End Module


PIDE NÚMERO ENTRE 0 Y 10

Module Ejercicio8

    Sub Main()

        Dim num As Integer

        Do
            Console.WriteLine("Escribe un numero entre 0 y 10")
            num = Console.ReadLine

        Loop While num <= 0 Or num >= 10

        Console.WriteLine("El número introducido es " & num)

        Console.ReadLine()

    End Sub

End Module


SALUDO

Module Ejercicio1

    Sub Main()

        Console.WriteLine("Escribe un nombre")
        Dim nombre As String = Console.ReadLine

        Console.WriteLine("¡Hola " & nombre & "!")

        Console.ReadLine()

    End Sub

End Module


TABLA DE MULTIPLICAR

Module Ejercicio3

    Sub Main()

        Console.WriteLine("Escribe un numero")
        Dim numero As Integer = Console.ReadLine

        For i As Integer = 1 To 10

            Console.WriteLine(numero & " x " & i & " = " & numero * i)

        Next

        Console.ReadLine()

    End Sub

End Module



lunes, 24 de junio de 2019

Ejercicios Primera Parte

 HOLA MUNDO
Código:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        MsgBox("HolaMundo")

    End Sub
End Class




SUMA DE 2 NÚMEROS

Código:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim A, B, SUMA As Double
        A = TextBox1.Text
        B = TextBox2.Text
        SUMA = A + B
        TextBox3.Text = Trim(SUMA)

    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""

    End Sub

End Class

CALCULADORA

Código:

Public Class Form1
    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        TextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
    End Sub

End Class



PROMEDIO

Código:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim A, B, C, D, Promedio As Double
        A = TextBox1.Text
        B = TextBox2.Text
        C = TextBox3.Text
        D = TextBox5.Text
        Promedio = (A + B + C + D) / 4
        TextBox4.Text = Trim(Promedio)

    End Sub

End Class


CUESTIONARIO

Código:

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim puntaje
        puntaje = 0
        If RadioButton1.Checked = True Then puntaje = puntaje + 2
        If RadioButton6.Checked = True Then puntaje = puntaje + 2
        If RadioButton9.Checked = True Then puntaje = puntaje + 2
        If RadioButton12.Checked = True Then puntaje = puntaje + 2
        If RadioButton13.Checked = True Then puntaje = puntaje + 2
        MsgBox("Su puntaje es:" + Str(puntaje) + "sobre 10")
    End Sub

End Class


CONVERTIDOR TEMPERATURA

Código:

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim A, SUMA As Double
        A = TextBox1.Text
        SUMA = (A * 1.8 + 32)
        TextBox2.Text = Trim(SUMA)
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim A, SUMA As Double
        A = TextBox1.Text
        SUMA = ((A - 32) / 1.8)
        TextBox2.Text = Trim(SUMA)
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Dim A, SUMA As Double
        A = TextBox1.Text
        SUMA = (A + 273.15)
        TextBox2.Text = Trim(SUMA)
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        Dim A, SUMA As Double
        A = TextBox1.Text
        SUMA = (A - 273.15)
        TextBox2.Text = Trim(SUMA)
    End Sub

    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        TextBox1.Text = ""
        TextBox2.Text = ""

    End Sub

    Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
        Application.Exit()
    End Sub

End Class

ÁREA DEL CÍRCULO

Código:

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim radio, resultado As Integer
        radio = Val(TextBox1.Text)

        If radio = 0 Then
            MsgBox("Teclee informacion mayor a 0 ")
            Exit Sub
        End If
        resultado = 3.1416 * (radio * radio)
        TextBox2.Text = Trim(resultado)


    End Sub

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

End Class


ÁREA DEL TRIÁNGULO

Código:

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim base, altura, resultado As Integer
        base = Val(TextBox1.Text)
        altura = Val(TextBox2.Text)

        If base = 0 Or altura = 0 Then
            MsgBox("Teclee informacion mayor a 0")
            Exit Sub
        End If
        resultado = base * altura / 2
        TextBox3.Text = Trim(resultado)


    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""

    End Sub

End Class



FORMULARIO

Código:

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Form2.TextBox1.Text = Me.TextBox1.Text
        Form2.TextBox2.Text = Me.TextBox2.Text
        Form2.TextBox3.Text = Me.TextBox3.Text
        Form2.TextBox4.Text = Me.TextBox4.Text
        



    End Sub

    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
        Form2.Show()
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
    End Sub

End Class




FACTORIAL

Código:

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim num, i, factorial As Integer
        num = (Int(TextBox1.Text))
        factorial = 1
        For i = 1 To num
            factorial = factorial * i
        Next
        TextBox2.Text = factorial

    End Sub

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

End Class


Exámenes Unidad No.1







































































Ejercicios Link Unidad No.3 Lenguaje Ensamblador

https://mega.nz/#F!30lAhSCB !eJSPm_L1GaETO7qZ1FmiQg *Cambia todas las letras a minúsculas *CBW Y CWD *Definición del Segmento de datos ...