La descarga está en progreso. Por favor, espere

La descarga está en progreso. Por favor, espere

ESTRUCTURAS DE CONTROL SELECTIVA LUIS OCTAVIO BUSTAMANTE Docente Colegio de la UPB.

Presentaciones similares


Presentación del tema: "ESTRUCTURAS DE CONTROL SELECTIVA LUIS OCTAVIO BUSTAMANTE Docente Colegio de la UPB."— Transcripción de la presentación:

1 ESTRUCTURAS DE CONTROL SELECTIVA LUIS OCTAVIO BUSTAMANTE Docente Colegio de la UPB

2 CONDICIONAL SI Es una función de tipo lógico que sirve para evaluar una condición (pregunta) y obtener una respuesta de verdadero o falso.

3 OPERADORES DE COMPARACIÓN > Mayor >= Mayor Igual < Menor <= Menor e igual = igual <> Diferente

4 SENTENCIA SIMPLE Sintaxis If (condición) then acciones End if Condición Acción SI

5 Ejemplo Module Module1 Sub Main() Dim edad As Integer Console.WriteLine("Ingrese una edad: ") edad = Console.ReadLine If (edad >= 18) Then Console.WriteLine("Tiene cédula...") End If Console.ReadLine() End Sub End Module

6 SENTENCIA DOBLE Sintaxis If (condición) then Acciones Else Acciones End if Condición Acción SI Acción NO

7 Module Module1 Sub Main() Dim valor As Single Console.WriteLine("Digite un número: ") valor = Console.ReadLine If valor > 0 Then Console.WriteLine("El número es POSITIVO") Else Console.WriteLine("El número es NEGATIVO") End If Console.ReadLine() End Sub End Module

8 SENTENCIA MULTIPLE Sintaxis If (condición) then Acciones ElseIf (condición 2) then Acciones ElseIf (condición 2) then Acciones End if

9 Condición Acción SINO Condición Acción SINO Condición

10 Module Module1 Sub Main() Dim nota As Double Console.WriteLine("Digite la nota definitiva: ") nota = Console.ReadLine If (nota >= 3.5) Then Console.WriteLine(“Estudiante GANA") ElseIf (nota < 2) Then Console.WriteLine(“Estudiante PIERDE") Else Console.WriteLine(“Estudiante REFUERZA") End If Console.ReadLine() End Sub End Module


Descargar ppt "ESTRUCTURAS DE CONTROL SELECTIVA LUIS OCTAVIO BUSTAMANTE Docente Colegio de la UPB."

Presentaciones similares


Anuncios Google