Voto Electronico: Sub Dim As Integer Dim As Double Dim As String Do
Voto Electronico: Sub Dim As Integer Dim As Double Dim As String Do
Module Module1
Sub Main()
Dim a, i, VM, VJ, VP As Integer
Dim PM, PJ, PP As Double
Dim res As String
Do
Console.Clear()
Console.WriteLine("MENU DE CANDIDATOS")
Console.WriteLine("1. RAFAEL CORREA")
Console.WriteLine("2. ALBARO NOVOA")
Console.WriteLine("3. LUCIO GUTIERREZ")
Console.WriteLine()
For i = 1 To 7 Step 1
Console.WriteLine("INGRESE EL NUMERO DEL CANDIDATO: ")
a = Console.ReadLine()
If a = 1 Then
VM = VM + 1
ElseIf a = 2 Then
VJ = VJ + 1
ElseIf a = 3 Then
VP = VP + 1
End If
Next i
PM = (VM / 7) * 100
PJ = (VJ / 7) * 100
PP = (VP / 7) * 100
Console.WriteLine("RESULTADOS DE LAS ELECCIONES")
Console.WriteLine("EL CANDIDATO RAFAEL CORREA OBTUVO DE VOTOS: " & VM)
Console.WriteLine("EL NUMERO DE LOS ELECTORES:" & Format(PM, "0.00"))
Console.WriteLine("EL CANDIDATO ALVARO NOVOA OBTUVO DE VOTOS: " & VJ)
Console.WriteLine("EL NUMERO DE LOS ELECTORES:" & Format(PJ, "0.00"))
Console.WriteLine("EL CANDIDATO LUCIO GUTIERREZ OBTUVO DE VOTOS: " & VP)
Console.WriteLine("EL NUMERO DE LOS ELECTORES:" & Format(PP, "0.00"))
Console.WriteLine()
Console.WriteLine("Desea ejecutar otra vez: SI <<s>> NO <<n>>: ")
res = Console.ReadLine()
Loop Until (res = "n" Or res = "N")
End Sub
End Module
CAJERO AUTOMATICO
Public Class cajero
Dim i As Integer
End If
Me.Hide()
Form2.n.Text = Me.u.Text
Form2.Show()
End Sub
End Sub
End Sub
End Sub
End Sub
Me.Hide()
retiro.t4.Text = t7.Text
retiro.Show()
Me.Hide()
End Sub
End Sub
End Class
Public Class deposito
Dim s As Integer
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button11.Click
t1.Text = s
t3.Text = Val(t1.Text) + Val(t2.Text)
s = Val(t3.Text) + s
End Sub
End Sub
End Sub
Me.Hide()
Form2.t7.Text = Me.t3.Text
Form2.Show()
End Sub
End Sub
End Class
Public Class retiro
Dim s As Integer
End Sub
End Sub
End Sub
End Class
NUMEROS
Module Module1
Sub Main()
Dim num, suma, s1, s2, s3, s4, i, j As Integer
Dim pro As Decimal
s1 = 0
s2 = 0
s3 = 0
s4 = 0
suma = 0
For i = 1 To 5
Console.Write("Ingresar un nmero: ")
num = Console.ReadLine()
If num > 0 Then
s1 = s1 + 1
End If
If num < 0 Then
s2 = s2 + 1
End If
If num Mod 2 = 0 Then
s3 = s3 + 1
Else
s4 = s4 + 1
End If
Next
Do
j=j+1
suma = suma + num
pro = suma / j
Loop Until (j = i)
End Module
BILLETES
Module Module1
Sub Main()
Dim dinero, cien, cincuenta, veinte, diez, cinco, uno As Integer
Console.WriteLine("INGRESE LA CANTIDAD DE DINERO EN DOLARES")
dinero = Console.ReadLine()
cien = dinero / 100
cincuenta = (dinero - (cien * 100)) / 50
veinte = (dinero - (cien * 100) - (cincuenta * 50)) / 20
diez = (dinero - (cien * 100) - (cincuenta * 50) - (veinte * 20)) / 10
cinco = (dinero - (cien * 100) - (cincuenta * 50) - (veinte * 20) - (diez * 10)) / 5
uno = (dinero - (cien * 100) - (cincuenta * 50) - (veinte * 20) - (diez * 10) - (cinco * 5)) / 1
Console.WriteLine("Los billetes de $100 son:" & cien)
Console.WriteLine("Los billetes de $50 son:" & cincuenta)
Console.WriteLine("Los billetes de $20 son:" & veinte)
Console.WriteLine("Los billetes de $10 son:" & diez)
Console.WriteLine("Los billetes de $5 son:" & cinco)
Console.WriteLine("Los billetes de $1 son:" & uno)
Console.ReadKey()
End Sub
End Module
BOLITAS DE COLOR
Module Module1
Sub Main()
Dim color As String
Dim compra, valor As Double
Dim r As Char
Do
Console.Clear()
Console.WriteLine(" VALOR A PAGAR DESCUENTO LA BOLITA SACADA")
Console.WriteLine("INGRESE EL VALOR DE LA COMPRA")
compra = Console.ReadLine()
Console.WriteLine("INGRESE EL COLOR DE LA BOLITA")
color = Console.ReadLine()
Console.WriteLine()
Select Case color
Case "rojo"
valor = compra * 0.7
Console.WriteLine("El valor ed la compra a pagar es" & valor)
Case "azul"
valor = compra * 0.8
Console.WriteLine("El valor ed la compra a pagar es" & valor)
Case "blanco"
valor = compra * 0.8
Console.WriteLine("El valor ed la compra a pagar es" & valor)
Case Else
Console.WriteLine("Error: COLOR NO VALIDO")
Console.ReadKey()
End Select
Console.WriteLine("Quiere ejectuar orta vez <<si>> <<no>>")
r = Console.ReadLine()
Loop Until (r = "N")
End Sub
End Module
PLANO CARTESIANO
Module Module1
Sub Main()
Dim x, y As Integer
Console.WriteLine("UBICACION DE UN PUNTO EN EL CUADRANTE RESPECTIVO(OSEA PRISC
TIENES")
Console.WriteLine("UBICAR UN PUNTO EN LOS CUADRANTES DEL PLANO CARTESIANO I,II,III,IV")
Console.WriteLine("ingrese punto en eje x:")
x = Console.ReadLine()
Console.WriteLine("ingrese punto en eje y:")
y = Console.ReadLine()
If (x > 0) And (y > 0) Then
Console.WriteLine("el punto va en el cuadrante I", x, y)
ElseIf (x < 0) And (y < 0) Then
Console.WriteLine("el punto va en el cuadrante III", x, y)
ElseIf (x < 0) And (y > 0) Then
Console.WriteLine("el punto va en el cuadrante II", x, y)
ElseIf (y < 0) And (x > 0) Then
Console.WriteLine("el punto va en el cuadrante IV", x, y)
ElseIf (y = 0) And (x > 0) Or (y > 0) Or (x = 0) Then
Console.WriteLine("el punto va en el cuadrante I", x, y)
ElseIf (y = 0) And (x < 0) Or (y < 0) Or (x = 0) Then
Console.WriteLine("el punto va en el cuadrante III", x, y)
End If
Console.WriteLine("el punto es el origen de Coordenadas")
Console.ReadKey()
End Sub
End Module
CEVICHERIA
Module Module1
Sub Main()
Dim subtotal, opc As Integer
Console.WriteLine("CEVICHERIA LOS MARISCOS DE MI TIERRA")
Console.WriteLine(" 1.Ceviche de Concha 8.00")
Console.WriteLine(" 2.Ceviche de Camaron 8.00")
Console.WriteLine(" 3.Ceviche de Pescado 5.00")
Console.WriteLine(" 4.Ceviche de Concha ")
Console.WriteLine("Ingresar la opcion del menu")
opc = Console.ReadLine()
Select Case (opc)
Case 1
subtotal = 8.0
Console.WriteLine(subtotal)
Case 2
subtotal = 8.0
Console.WriteLine(subtotal)
Case 3
subtotal = 5.0
Console.WriteLine(subtotal)
Case 4
opc = 4
Console.WriteLine(subtotal)
End Select
Console.WriteLine("TOTAL A PAGAR ES :" & subtotal)
Console.ReadKey()
End Sub