EJERCICIO 1 Cuadro de notas entre 0 y 10 representan las

Anuncio
EJERCICIO 1
Cuadro de notas entre 0 y 10 representan las calificación de un estudiante de un curso de
programación. Elaborar una aplicación para obtener el promedio de esas calificaciones y visualizar
su puntuación de acuerdo al siguiente cuadro
CODIGOS DE EJECUTAR
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim a, b, c, d As Integer
Dim pro As Integer
a = TextBox1.Text
b = TextBox2.Text
c = TextBox3.Text
d = textbox4.text
pro = (a + b + c + d) / 4
TextBox5.Text = pro
If pro >= 9 Then
TextBox6.Text = " A "
Else
If pro >= 7 Then
TextBox6.Text = " B "
Else
If pro >= 5 Then
TextBox6.Text = " C "
Else
If pro >= 3 Then
TextBox6.Text = " D "
Else
If pro >= 0 Then
TextBox6.Text = " E "
End If
End If
End If
End If
End If
End Sub
End Class
EJERCICIO 2
Un empleado percibe $ 5.00 por hora por las 40 primeras horas trabajadas y $ 7,00 por cada hora
siguiente de las 40. Calcular, imprimir y autorizar el ingreso neto del trabajador.
CODIGOS DE EJECUTAR
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim l, i, t As Integer
l = TextBox1.Text
i = TextBox2.Text
If l <= 40 Then
t = l * 5
Else
t = (l * 5) + (i * 7)
End If
TextBox3.Text = t
End Sub
End Class
EJERCICIO 3
El costo de las llamadas telefónicas internacionales, dependen de
zonas geográficas en las que se encuentra el país de destino y el
numero de los minutos hablados. En la siguiente tabla se presenta
el costo por minuto de acuerdo a la zona. A cada zona se asocia
una clave, imprimir a k zona hablo, el precio del minuto hablado,
el IVA y el total a pagar
CODIGOS DE EJECUTAR
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim a, b, i, t As Integer
a = TextBox1.Text
b = TextBox2.Text
Select Case a
Case 1
TextBox3(" AMERICA DEL NORTE ")
TextBox4.Text = " 2 "
i = (b * 2) * 0.12
t = i + (b * 2)
Case 2
TextBox3 = " AMERICA CENTRAL "
TextBox4.Text = " 2,2 "
i = (b * 2.2) * 0.12
t = i + (b * 2.2)
Case 3
TextBox3 = " AMERICA DEL SUR "
TextBox4.Text = " 4,5 "
i = (b * 4.5) * 0.12
t = i + (b * 4.5)
Case 4
TextBox3 = " EUROPA "
TextBox4.Text = " 3,5 "
i = (b * 3.5) * 0.12
t = i + (b * 3.5)
Case 5
TextBox3 = " ASIA "
TextBox4.Text = " 6 "
i = (b * 6) * 0.12
t = i + (b * 6)
Case 6
TextBox3 = " AFRICA "
TextBox4.Text = " 6 "
i = (b * 6) * 0.12
t = i + (b * 6)
Case 7
TextBox3 = " OCEANIA "
TextBox4.Text = " 5 "
i = (b * 5) * 0.12
t = i + (b * 5)
End Select
EJERCICIO 4
Verifique si un número es par o impar, utilizando el operador MOD
CODIGOS DE EJECUTAR
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim a As Integer
a = TextBox1.Text
If (a Mod 2 = 0) Then
TextBox2.Text = " PAR "
Else
TextBox2.Text = " IMPAR"
End If
End Sub
End Class
EJERCICIO 5
Ingrese tres números por medio del teclado e imprima los mismos en forma orden descendente.
CODIGOS DE EJECUTAR
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim a, b, c As Integer
a = TextBox1.Text
b = TextBox2.Text
c = TextBox3.Text
If a > b Then
If a > c Then
TextBox4.Text = a
If b > c Then
TextBox5.Text = b
TextBox6.Text = c
Else
TextBox5.Text = c
TextBox6.Text = b
End If
Else
TextBox4.Text = c
TextBox5.Text = a
TextBox6.Text = b
End If
Else
If b > c Then
TextBox4.Text = b
If b > c Then
TextBox5.Text = a
TextBox6.Text = c
Else
TextBox5.Text = c
TextBox6.Text = a
End If
Else
TextBox4.Text = c
TextBox5.Text = b
TextBox6.Text = a
End If
End If
Descargar