Skip to content

Commit

Permalink
Ejercicio 09.- “while” VS “do while” en Visual Basic.NET [34]⛓️
Browse files Browse the repository at this point in the history
  • Loading branch information
programadornovato committed Jul 13, 2021
1 parent 7dbd963 commit 188f362
Showing 1 changed file with 43 additions and 19 deletions.
62 changes: 43 additions & 19 deletions VisualBasic/Program.vb
Expand Up @@ -6,26 +6,50 @@ Imports System
Module Program
'Este codigo escribe un texto en amarillo con fondo azul
Public Sub Main(args As String())
'Dim i = 11
'Do
' Console.WriteLine("i=" & i)
' i = i + 1
'Loop While i <= 10

'Dim i = -10
'Do
' Console.WriteLine("i=" & i)
' i = i - 1
'Loop While i >= 1

Dim rand = New Random()
Dim aleatorio = rand.Next(1, 7)
Console.WriteLine("aleatorio=" & aleatorio)
Dim i = 10
'Console.WriteLine("Hola humano por favor ingresa una de las siguientes opciones")
'Console.WriteLine("1.- Acceso")
'Console.WriteLine("2.- Configuracion")
'Console.WriteLine("3.- Salir")
'Dim opcion = Integer.Parse(Console.ReadLine())
'While opcion <> 3
' Select Case opcion
' Case 1
' Console.WriteLine("Seleccionaste el acceso")
' Case 2
' Console.WriteLine("Seleccionaste el configuracion")
' Case 3
' Console.WriteLine("Adios humano, te voy a extrañar")
' Case Else
' Console.WriteLine("Humano estupido te pedi que ingresara 1 o 2 o 3")
' End Select
' Console.WriteLine("Hola humano por favor ingresa una de las siguientes opciones")
' Console.WriteLine("1.- Acceso")
' Console.WriteLine("2.- Configuracion")
' Console.WriteLine("3.- Salir")
' opcion = Integer.Parse(Console.ReadLine())
'End While
'If opcion = 3 Then
' Console.WriteLine("Adios humano, te voy a extrañar")
'End If
Dim opcion = 0
Do
Console.WriteLine("i=" & i)
i = i + 1
Loop While i <= aleatorio
Console.WriteLine("Hola humano por favor ingresa una de las siguientes opciones")
Console.WriteLine("1.- Acceso")
Console.WriteLine("2.- Configuracion")
Console.WriteLine("3.- Salir")
opcion = Integer.Parse(Console.ReadLine())
Select Case opcion
Case 1
Console.WriteLine("Seleccionaste el acceso")
Case 2
Console.WriteLine("Seleccionaste el configuracion")
Case 3
Console.WriteLine("Adios humano, te voy a extrañar")
Case Else
Console.WriteLine("Humano estupido te pedi que ingresara 1 o 2 o 3")
End Select
Loop While opcion <> 3

Console.Read()
End Sub
End Module

0 comments on commit 188f362

Please sign in to comment.