0% found this document useful (0 votes)
57 views7 pages

Voto Electronico: Sub Dim As Integer Dim As Double Dim As String Do

The document describes code for several programs: 1. An electronic voting program that allows a user to vote for one of three candidates and displays vote totals. 2. An ATM program with interfaces for login, depositing money, withdrawing money, and checking balances. 3. A program that analyzes numbers entered by the user, counting positive, negative, even and odd numbers, and calculates the average. 4. A program that takes a dollar amount as input and calculates the number of each bill denomination needed to make change. 5. A program for a game that tracks purchases of colored balls and applies discounts.

Uploaded by

Miguel Angel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views7 pages

Voto Electronico: Sub Dim As Integer Dim As Double Dim As String Do

The document describes code for several programs: 1. An electronic voting program that allows a user to vote for one of three candidates and displays vote totals. 2. An ATM program with interfaces for login, depositing money, withdrawing money, and checking balances. 3. A program that analyzes numbers entered by the user, counting positive, negative, even and odd numbers, and calculates the average. 4. A program that takes a dollar amount as input and calculates the number of each bill denomination needed to make change. 5. A program for a game that tracks purchases of colored balls and applies discounts.

Uploaded by

Miguel Angel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

VOTO ELECTRONICO

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

Private Sub b_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b.Click


i=i+1

If (u.Text = "m") And (c.Text = "1234") Then


Form2.Show()
Else
MsgBox("el usuario y la clave son incorrectos, fracasaste")
If (i = 3) Then
MsgBox("supero el numero de intentos")
End If

End If
Me.Hide()
Form2.n.Text = Me.u.Text
Form2.Show()
End Sub

Private Sub cajero_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


MyBase.Load

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
u.Text = " "
c.Text = " "

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button2.Click
End
End Sub
End Class
Public Class Form2
Dim s As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
Me.Hide()
deposito.Show()
s=0
t7.Text = s

End Sub

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


MyBase.Load

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button2.Click

Me.Hide()
retiro.t4.Text = t7.Text
retiro.Show()
Me.Hide()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button3.Click
MsgBox("su saldo es: "& t7.Text)

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

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
t2.Text = t2.Text & "1"

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button2.Click
t2.Text = t2.Text & "2"
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button3.Click
t2.Text = t2.Text & "3"
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button4.Click
t2.Text = t2.Text & "4"
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button5.Click
t2.Text = t2.Text & "5"
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button6.Click
t2.Text = t2.Text & "6"
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button7.Click
t2.Text = t2.Text & "7"
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button8.Click
t2.Text = t2.Text & "8"
End Sub

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button9.Click
t2.Text = t2.Text & "9"
End Sub

Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button10.Click
t2.Text = t2.Text & "0"
End Sub

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button12.Click

t2.Text = " "


t3.Text = " "

End Sub

Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button13.Click

Me.Hide()
Form2.t7.Text = Me.t3.Text
Form2.Show()
End Sub

Private Sub deposito_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub
End Class
Public Class retiro
Dim s As Integer

Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button11.Click

t6.Text = Val(t4.Text) - Val(t5.Text)


s = s - Val(t6.Text)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
t5.Text = t5.Text & "1"
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button2.Click
t5.Text = t5.Text & "2"
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button3.Click
t5.Text = t5.Text & "3"
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button4.Click
t5.Text = t5.Text & "4"
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button5.Click
t5.Text = t5.Text & "5"
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button6.Click
t5.Text = t5.Text & "6"
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button7.Click
t5.Text = t5.Text & "7"
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button8.Click
t5.Text = t5.Text & "8"
End Sub

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button9.Click
t5.Text = t5.Text & "9"
End Sub

Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button10.Click
t5.Text = t5.Text & "0"
End Sub

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button12.Click
t4.Text = t6.Text
t5.Text = ""
t6.Text = " "
End Sub

Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button13.Click
Me.Hide()
Form2.t7.Text = t6.Text
Form2.Show()
Me.Hide()

End Sub

Private Sub retiro_Load(sender As Object, e As EventArgs) Handles MyBase.Load

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)

Console.WriteLine("Se ingreso: " & s1 & " nmeros positivos")


Console.WriteLine("Se ingreso: " & s2 & " nmeros negativos")
Console.WriteLine("Se ingreso: " & s3 & " nmeros pares")
Console.WriteLine("Se ingreso: " & s4 & " nmeros impares")
Console.WriteLine("El promedio de todos los numeros ingresados es: " & pro)
Console.ReadKey()
End Sub

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

You might also like