Sei sulla pagina 1di 4

DIA MES Y AO ZODIACAL

Module Pregunta16_CASE
Sub Main()
Dim dia, mes As Integer
Console.Write("Ingresa el N DIA:")
dia = Console.ReadLine
Console.Write("Ingresa el N MES:")
mes = Console.ReadLine
Console.Write("RESULTADO :")
Console.WriteLine(SignoZodiacal(dia, mes))
Console.ReadLine()
End Sub
Public Function SignoZodiacal(ByVal dia As Integer, ByVal mes As
Integer) As String
SignoZodiacal = ""
Select Case mes
Case 3 And dia >= 21
SignoZodiacal = "ARIES"
Case 4 And dia <= 20
SignoZodiacal = "ARIES"
Case 4 And dia >= 21
SignoZodiacal = "TAURO"
Case 5 And dia <= 20
SignoZodiacal = "TAURO"
Case 5 And dia >= 21
SignoZodiacal = "GEMINIS"
Case 6 And dia <= 20
SignoZodiacal = "GEMINIS"
Case 6 And dia >= 21
SignoZodiacal = "CANCER"
Case 7 And dia <= 20
SignoZodiacal = "CANCER"
Case 7 And dia >= 21
SignoZodiacal = "LEO"
Case 8 And dia <= 20
SignoZodiacal = "LEO"
Case 8 And dia >= 21
SignoZodiacal = "VIRGO"
Case 9 And dia <= 20
SignoZodiacal = "VIRGO"
Case 9 And dia >= 21
SignoZodiacal = "LIBRA"
Case 10 And dia <= 20
SignoZodiacal = "LIBRA"
Case 10 And dia >= 21
SignoZodiacal = "ESCORPION"
Case 11 And dia <= 20
SignoZodiacal = "ESCORPION"
Case 11 And dia >= 21
SignoZodiacal = "SAGITARIO"
Case 12 And dia <= 20
SignoZodiacal = "SAGITARIO"
Case 12 And dia >= 21
SignoZodiacal = "CAPRICORNIO"
Case 1 And dia <= 20
SignoZodiacal = "CAPRICORNIO"
Case 1 And dia >= 21
SignoZodiacal = "ACUARIO"
Case 2 And dia <= 20
SignoZodiacal = "ACUARIO"
Case 2 And dia >= 21
SignoZodiacal = "PISCIS"
Case 3 And dia <= 20
SignoZodiacal = "PISCIS"
End Select
End Function

End Module
ZODIACAL

Module Pregunta16_IF
Sub Main()
Dim dia, mes As Integer
Console.Write("Ingresa el N DIA:")
dia = Console.ReadLine
Console.Write("Ingresa el N MES:")
mes = Console.ReadLine
Console.Write("RESULTADO :")
Console.WriteLine(SignoZodiacal(dia, mes))
Console.ReadLine()
End Sub
Public Function SignoZodiacal(ByVal dia As Integer, ByVal mes As
Integer) As String
SignoZodiacal = ""
If dia >= 21 And mes = 3 Then
SignoZodiacal = "ARIES"
ElseIf dia <= 20 And mes = 4 Then
SignoZodiacal = "ARIES"


ElseIf dia >= 21 And mes = 4 Then
SignoZodiacal = "TAURO"
ElseIf dia <= 20 And mes = 5 Then
SignoZodiacal = "TAURO"


ElseIf dia >= 21 And mes = 5 Then
SignoZodiacal = "GEMINIS"
ElseIf dia <= 20 And mes = 6 Then
SignoZodiacal = "GEMINIS"


ElseIf dia >= 21 And mes = 6 Then
SignoZodiacal = "CANCER"
ElseIf dia <= 20 And mes = 7 Then
SignoZodiacal = "CANCER"


ElseIf dia >= 21 And mes = 7 Then
SignoZodiacal = "LEO"
ElseIf dia <= 20 And mes = 8 Then
SignoZodiacal = "LEO"


ElseIf dia >= 21 And mes = 8 Then
SignoZodiacal = "VIRGO"
ElseIf dia <= 20 And mes = 9 Then
SignoZodiacal = "VIRGO"


ElseIf dia >= 21 And mes = 9 Then
SignoZodiacal = "LIBRA"
ElseIf dia <= 20 And mes = 10 Then
SignoZodiacal = "LIBRA"


ElseIf dia >= 21 And mes = 10 Then
SignoZodiacal = "ESCORPION"
ElseIf dia <= 20 And mes = 11 Then
SignoZodiacal = "ESCORPION"


ElseIf dia >= 21 And mes = 11 Then
SignoZodiacal = "SAGITARIO"
ElseIf dia <= 20 And mes = 12 Then
SignoZodiacal = "SAGITARIO"

ElseIf dia >= 21 And mes = 12 Then
SignoZodiacal = "CAPRICORNIO"
ElseIf dia <= 20 And mes = 1 Then
SignoZodiacal = "CAPRICORNIO"


ElseIf dia >= 21 And mes = 1 Then
SignoZodiacal = "ACUARIO"
ElseIf dia <= 20 And mes = 2 Then
SignoZodiacal = "ACUARIO"


ElseIf dia >= 21 And mes = 2 Then
SignoZodiacal = "PISCIS"
ElseIf dia <= 20 And mes = 3 Then
SignoZodiacal = "PISCIS"
End If
End Function
End Module







Module Module1

Sub Main()
Dim A(9) As Integer
Console.WriteLine("ingrese numero")
Console.WriteLine()

Call ingresonum(A, 9)
Call max(A, 9)
Console.WriteLine()


Console.ReadLine()
End Sub
Sub ingresonum(ByRef A() As Integer, ByVal size As Integer)

Dim c As Integer
For c = 0 To size Step 1
Console.Write("posicion de numero A[{0}]es:", c)
A(c) = Console.ReadLine()
Next
End Sub
Sub max(ByRef A() As Integer, ByVal size As Integer)
Dim max As Integer
Dim c As Integer
max = 6
For c = 0 To size Step 1

If A(c) >= max Then
max = A(c)
Else
Console.WriteLine("el mayor[{0}] es :A(c)")

Console.ReadLine()


End If
Console.ReadLine()




Next
End Sub




End Module

Potrebbero piacerti anche