VERIFICACION
12.- Investigar el horóscopo chino y hacer el cálculo respectivo, conociendo el mes y el año.
PSEUDOCODIGO
definir n como real
escribir"INGRESE SU AÑO DE NACIMIENTO"
leer n
Segun n Hacer 1936,1948,1960,1972,1984,1996,2008:
escribir"segun el Horoscopo chino eres: LA RATA"
1937,1949,1961,1973,1985,1997,2009:
Escribir "segun el Horoscopo chino eres: EL BUEY"
1938,1950,1962,1974,1986,1998,2010:
escribir "segun el Horoscopo chino eres: EL TIGRE"
1939,1951,1963,1975,1987,1999,2011:
escribir "segun el Horoscopo chino eres: EL CONEJO"
1940,1952,1964,1976,1988,2000,2012:
escribir "segun el Horoscopo chino eres: EL DRAGON"
1941,1953,1965,1977,1989,2001,2013:
escribir "segun el Horoscopo chino eres: LA SERPIENTE"
1942,1954,1966,1978,1990,2002,2014:
escribir "segun el Horoscopo chino eres: EL CABALLO"
1943,1955,1967,1979,1991,2003,2015:
escribir "segun el Horoscopo chino eres: LA CABRA"
1944,1956,1968,1980,1992,2004,2016:
escribir "segun el Horoscopo chino eres: EL MONO"
1945,1957,1969,1981,1993,2005,2017:
escribir "segun el Horoscopo chino eres: EL GALLO"
1946,1958,1970,1982,1994,2006,2018:
escribir "segun el Horoscopo chino eres: EL PERRO"
1947,1959,1971,1983,1995,2007,2019:
escribir "segun el Horoscopo chino eres: EL CERDO" De
Otro Modo:
escribir "no corresponde"
Fin Segun
FinAlgoritmo
DIAGRAMA DE
FLUJO
CODIFICACION
VERIFICACION
14.- Petronita organiza una fiesta en la cual una computadora controla el ingreso mediante 5 claves.Si se ingresa
al menos una clave incorrecta esta imprimirá "TE EQUIVOCASTE DE FIESTA" y no permitirá el ingreso. Si las 5
claves son correctas imprimirá "BIENVENIDO A LA FIESTA"
Las Claves son:
1: "TIENES"
2: "QUE SER"
3: "INVITADO"
4: "PARA"
5: "INGRESAR"
PSEUDOCODIGO
escribir "introduzca la primera clave"
Leer C1
Si C1<>"TIENES" Entonces
escribir "Te Equivocaste de Fiesta"
SiNo
escribir "Ingrese la Clave2"
Fin Si
Leer C2
Si C2<>"QUE_SER" Entonces
escribir "Te Equivocaste de Fiesta"
SiNo
escribir "Ingrese la Clave 3"
Fin Si
leer C3
Si C3<>"INVITADO" Entonces
escribir "Te Equivocaste de Fiesta"
SiNo
escribir "Ingrese la Clave 4"
Fin Si
leer C4
Si C4<>"PARA" Entonces
escribir "Te Equivocaste de Fiesta"
SiNo
escribir "Ingrese la Clave 5"
Fin Si
leer C5
Si C5<>"INGRESAR" Entonces
escribir "Te Equivocaste de Fiesta"
SiNo
escribir "Bienvenido a la Fiesta"
Fin Si
FinAlgoritmo
DIAGRAMA DE FLUJO
CODIFICACION
VERIFICACION
16.Dada un fecha diga cuantos días faltan para que acabe el año
DEFINIR dia,mes,año,falta COMO ENTERO
ESCRIBIR "Ingresa el dia"
LEER dia
ESCRIBIR "Ingresa el mes: "
LEER mes
ESCRIBIR "Ingresa el año: "
LEER año
Si year%4==0 y year%100==0&year%400<>0 Entonces
x=29
Sino
x=28
Fin
Si
Segun mes Hacer
1: d=0
2: d=31
3: d=31+x
4:d=31+x+31
5:d=31+x+31+30
6:d=31+x+31+30+31
7:d=31+x+31+30+31+30
8:d=31+x+31+30+31+30+31
9:d=31+x+31+30+31+30+31+31
10: d=31+x+31+30+31+30+31+31+3d=31+x+31+30+31+30+31+31+30+31
11: d=31+x+31+30+31+30+31+31+3 d=31+x+31+30+31+30+31+31+30+31
12:d=31+x+31+30+31+30+31+31+30+31+30
De Otro Modo:
falta=((337+x)-(dia+d))
Fin Segun
ESCRIBIR "La fecha actual es" dia/ mes/ año
ESCRIBIR falta "falta dias para finalizar el año."
DIAGRAMA DE FLUJO
CODIFICACION
VALIDACION
18.- Dada una fecha válida halle la fecha de dos días después.
CODIFICACION
DEFINIR DIA, MES,AÑO Como ENTERO
ESCRIBIR "INTRODUCIR EL DIA"
LEER DIA
ESCRIBIR "INTRODUCIR EL MES"
LEER MES
ESCRIBIR "INTRODUCIR EL AÑO"
LEER AÑO
Segun MES Hacer
1,3,5,7,8,10,12:
DMAX=31
4,6,9,11::
DMAX=30
2:
Si (AÑO %4 =0 Y (!(AÑO%100 =0) o AÑO%400 =0)) Entonces
DMAX=29
SiNo
DMAX=28
Fin Si
Fin Segun
DIA=DIA+1
Si DIA> DMAX Entonces
DIA=1
MES=1
SiNo
Si MES=13 Entonces
M=1
SiNo
AÑO=AÑO
Fin Si
Fin Si
DIA1=DIA+1
Si DIA1> DMAX Entonces
DIA1=1
MES=1
SiNo
Si MES=13 Entonces
MES=1
SiNo
AÑO=AÑO
Fin Si
Fin Si
ESCRIBIR "EL DIA SIGUIENTE ES...",DIA
ESCRIBIR "DEL MES...",MES
ESCRIBIR "DEL AÑO...",AÑO
ESCRIBIR "EL DIA SUBSIGUIENTE ES...",DIA1
ESCRIBIR "DEL MES...",MES
ESCRIBIR "DEL AÑO...",AÑO
FinAlgoritmo
DIAGRAMA DE FLUJO
COFIFICACION
VALIDACION