Está en la página 1de 8

================

PUNTO 1
================

Proceso sin_titulo
//Declaraci�n de Variables
Definir s1 ,s2 , s3, Notas_Defi, Notas_Regu, Notas_Buen, Notas_Exce Como
Entero;
//Cantidad de numero en donde el vector debe de llegar
s1<-20;
//Declaraci�n del tama�o del vector
Dimension s3[21];
//Contadores
Notas_Defi <-0;
Notas_Regu <-0;
Notas_Buen <-0;
Notas_Exce <-0;

Escribir "Calificaciones De Los Estudiantes: " ;


//Inicio del ciclo
// Recorre los 20 elementos y va asignandoles enteros aleatorios
Para s2<- 1 hasta s1 Hacer
s3[s2] <- (azar(5));
// Recorre los 20 elementos utilizando subindices y los muestra en
pantalla
Escribir " |" , s3[s2] , "| " Sin Saltar;
//Condicionales en donde se determinar� el tipo de calificaci�n
si (s3[s2] <=1) entonces
Notas_Defi <- Notas_Defi+1;
finsi
si (s3[s2] > 1.1 y s3[s2] <=3) entonces
Notas_Regu<- Notas_Regu+1;
finsi
si (s3[s2] >3.1 y s3[s2] <=4) entonces
Notas_Buen <- Notas_Buen+1;
finsi
si (s3[s2] >4 y s3[s2] <=5) entonces
Notas_Exce <- Notas_Exce+1;
Finsi;
FinPara
//Final del ciclo
Escribir" ";
Escribir "==========================";
Escribir" RESULTADOS: ";
Escribir "==========================";
Escribir " ";
Escribir "Estudiantes con Notas Deficiente: ", Notas_Defi;
Escribir "==========================";
Escribir "Estudiantes con Notas Regulares: ", Notas_Regu;
Escribir "==========================";
Escribir "Estudiantes con Notas Buenas: ", Notas_Buen;
Escribir "==========================";
Escribir "Estudiantes con Notas Excelentes: ", Notas_Exce;
Escribir "Ejecucion Finalizada";
FinProceso

=============
PUNTO 2
=============
Proceso INICIO
//DECLARACION DE VARIABLES
Definir s5, I,s1,s2,s3,s4,J,S6, x, s7 Como Entero;
//LONGITUD DE LOS VECTORES
Dimension s1(11),s2(11),s3(11),s4(11), s7[11];
Repetir
Limpiar Pantalla;
//MEN� PRINCIPAL
Escribir "____________MENU DE OPCIONES____________ " ;
Escribir "1=). LLENAR VECTOR A DE MANERA ALEATORIA." ;
Escribir "2=). LLENAR VECTOR B DE MANERA ALEATORIA." ;
Escribir "3=). C=A+B " ;
Escribir "4=). D=B-A " ;
Escribir "5=). MOSTRAR VECTORES";
Escribir "0=). SALIR" ;
//DATO DE ENTRADA
Leer s5;
segun s5 hacer
1:

Escribir "PROCESANDO INFORMACI�N...";


Escribir "=======";
Escribir "=======";
Escribir "=======";
// Recorre los elementos y va asignandoles numeros
aleatorios
Para I<-1 hasta 10 Hacer
s1(I)<- Aleatorio(-100,100);
FinPara

Escribir "VECTOR LLENADO";


Escribir "LOS RESULTADOS SE MUESTRAN EN LA OPCION 5 DEL
MENU";
Escribir "PRESIONE ENTER PARA VOLVER AL MEN�";
Esperar Tecla;

2:
Escribir "PROCESANDO INFORMACI�N...";
Escribir "=======";
Escribir "=======";
Escribir "=======";
// Recorre los elementos y va asignandoles numeros
aleatorios
para I<-1 hasta 10 Hacer
s2(I)<-Aleatorio(-100,100);
FinPara
Escribir "VECTOR LLENADO";
Escribir "=======";
Escribir "=======";
Escribir "=======";
Escribir "LOS RESULTADOS SE MUESTRAN EN LA OPCION 5 DEL
MENU";
Escribir "PRESIONE ENTER PARA VOLVER AL MEN�";
Esperar Tecla;

3:
Escribir "C=A+B";
//Suma de los vectores A Y B
Para J<-1 Hasta 10 hacer
s3(J)<-s1(J)+s2(J);
FinPara
Escribir "VECTOR LLENADO";
Escribir "=======";
Escribir "=======";
Escribir "=======";
Escribir "LOS RESULTADOS SE MUESTRAN EN LA OPCION 5 DEL
MENU";
Escribir "PRESIONE ENTER PARA VOLVER AL MEN�";
Esperar Tecla;
4:
Escribir "D=B-A";
//RESTA DE LOS VECTORES B - A
Para J<-1 Hasta 10 hacer
s4(J)<-s2(J)-s1(J);
FinPara
Escribir "VECTOR LLENADO";
Escribir "=======";
Escribir "=======";
Escribir "=======";
Escribir "LOS RESULTADOS SE MUESTRAN EN LA OPCION 5 DEL
MENU";
Escribir "PRESIONE ENTER PARA VOLVER AL MEN�";
Esperar Tecla;

5:
Repetir
Limpiar Pantalla;
//MEN� DE RESULTADOS
Escribir "SE�OR USUARIO, TENGA PRESENTE QUE SI USTED
NO INICIALIZ� EL VECTOR, EL SISTEMA LE ARROJARA ERROR. ";
Escribir "__________MOSTRAR VECTORES________";
Escribir "1=) VECTOR A";
Escribir "2=) VECTOR B";
Escribir "3=) VECTOR C";
Escribir "4=) VECTOR D";
Escribir "5=) VECTOR F (VECTOR INVERSO DE A)";
Escribir "0=) VOLVER AL MENU PRINCIPAL";
Escribir "DESEA USTED LA OPCI�N: ";
//DATO DE ENTRADA
leer s6;
Segun s6 Hacer
1:

Escribir "RESULTADO: VECTOR A";


para I<-1 hasta 10 Hacer
// Recorre los elementos utilizando
subindices y los muestra en pantalla
Escribir " ", "|" ,s1(I), "|" Sin
saltar;
FinPara
Esperar Tecla;
2:
Escribir "RESULTADO: VECTOR B";
para I<-1 hasta 10 Hacer
Escribir " ", "|" ,s2(I), "|" Sin
saltar;
FinPara
Esperar Tecla;
3:
Escribir "RESULTADO: VECTOR C";
para I=1 hasta 10 Hacer
Escribir " ", "|" ,s3(I), "|" Sin
saltar;
FinPara
Esperar Tecla;
4:
Escribir "RESULTADO: VECTOR D";
Para I=1 hasta 10 hacer
// Recorre los elementos utilizando
subindices y los muestra en pantalla
Escribir " ", "|" ,s4(I), "|" Sin
saltar;
FinPara
Esperar Tecla;
5:
Escribir "RESULTADO: VECTOR F";
x=10;
para I<-1 Hasta 10 Hacer
Escribir " ", "|" , s1[x-I+1], "|"
Sin saltar;
FinPara

Esperar Tecla;
0:
Escribir "EJECUCION FINALIZADA";

Finsegun

Hasta que s6==0;


Escribir "EJECUCION FINALIZADA";
De Otro Modo:
Escribir "EJECUCION FINALIZADA";

Finsegun
Hasta Que s5==0;
FinProceso
//FIN DEL PROGRAMA

===========
PUNTO 3
===========

TERCER_PUNTO
|
| Escribir "===TORNEO DE CARRERAS DE CABALLO===";
| Escribir "DISTANCIA RECCORRIDA POR LOS CABALLOS EN METROS"!
| Leer DIST;
| F<-2
| /*
| Diccionario
|
| s1<- Nombre del Jockey
| s2<- Nombre del Caballo
| s3<- Edad
| s4<- Peso
| s5<- Raza
| s6<- Tiempo
| */
| Dimension s1(X)
| Dimension s2(X)
| Dimension s3(X)
| Dimension s4(X)
| Dimension s5(X)
| Dimension s6(X)
| Dimension RESU(X)
| Definir s1,s2,s5 Como Caracter
| Definir s4,RESU,s6 Como real
| Definir s3 como Entero
| //REGISTRO

| Escribir DATOS A REGISTRAR";


//==================================================================
| Para I<-1 Hasta F Hacer
| | Escribir "===REGISTRO DEL COMPETIDOR No.",I," ===";
| | Escribir "EDAD DEL CABALLO";
| | Escribir "RECODAR QUE ES MENOR DE 7 AÑOS";
| | Leer s3(I)
| | Si s3(I)<7 Entonces
| | | Escribir "INGRESE EL NOMBRE DEL JOCKEY"
| | | Leer s1(I)
| | | Escribir "INGRESE EL NOMBRE DEL CABALLO"
| | | Leer s2(I)
| | | Escribir "INGRESE EL PESO DEL CABALLO EN LIBRAS"
| | | Leer s4(I)
| | | Escribir "INGRESE LA RAZA O PROCEDENCIA DEL CABALLO"
| | | Leer s5(I)
| | FinSi
| FinPara
//==================================================================
| Escribir "===DATOS REGISTRADOS===";
| Para I<-1 Hasta F Hacer
| | Escribir "COMPETIDOR No.",I
| | Escribir "EL NOMBRE DEL JOCKEY ES ",s1(I)
| | Escribir "EL NOMBRE DEL CABALLO ES ",s2(I)
| | Escribir "LA EDAD DEL CABALLO ES ",s3(I)," AÑOS"
| | Escribir "EL PESO DEL CABALLO ES ",s4(I)," LIBRAS"
| | Escribir "LA RAZA O PROCEDENCIA DEL CABALLO ES ",s5(I)
| Fin Para
| //DATOS OBTENIDOS
| Escribir "TIEMPOS OBTENIDOS";
| Limpiar pantalla
//==================================================================
| Para Z<-1 Hasta 10 Hacer
| | Escribir "===CARRERA NUMERO",Z, "===";
| | Para I<-1 Hasta F Hacer
| | | Escribir "COMPETIDOR NUMERO ",I
| | | Escribir "EL NOMBRE DEL JOCKEY ES ",s1(I)
| | | Escribir "EL NOMBRE DEL CABALLO ES ",s2(I)
| | | Escribir "DIGITE EL TIEMPO REALIZADO POR EL COMPETIDOR ",I;
| | | Leer s6(I)
| | | Escribir
"-------------------------------------------------------------------"
| | FinPara
| | //DATOS GENERADOS
//=================================================================
| | Para I<-1 Hasta F Hacer
| | RESU(I)<-s6(I)
| | Fin Para
| | Para K<-1 Hasta F Hacer
| | | Para J<-1 Hasta F-1 Hacer
| | | | Si RESU(J)>RESU(J+1)
| | | | | AUX<-RESU(J)
| | | | | RESU(J)<-RESU(J+1)
| | | | | RESU(J+1)<-AUX
| | | | Fin Si
| | | Fin Para
| | Fin Para
| | Para I<-1 Hasta F Hacer
| | Fin Para
| | Escribir "RESULTADOS DE LA CARRERA ",Z;
| | //GANADORES POR CARRERA
//==================================================================
| | Repetir
| | Para I<-1 Hasta F Hacer
| | | Si RESU(1)=TIEMPO(I) Entonces
| | | | Escribir "SU GANADADOR ES EL COMPETIDOR ",I
| | | | Escribir "EL NOMBRE DEL JOCKEY ES ",s1(I)
| | | | Escribir "EL NOMBRE DEL CABALLO ES ",s2(I)
| | | | Escribir "LA EDAD DEL CABALLO ES ",s3(I)," AÑOS"
| | | | Escribir "EL COMPETIDOR ",I," SE LLEVA LA CARRERA ",Z
| | | | Escribir "DESEA VER EL SEGUNDO PUESTO"
| | | | Leer L
| | | FinSi
| | FinPara
//==================================================================
| | Si L="SI" Entonces
| | | Para I<-1 Hasta F Hacer
| | | | Si RESU(2)=s6(I) Entonces
| | | | | Escribir "SU SEGUNDO PUESTO ES EL COMPETIDOR
",I
| | | | | Escribir "EL NOMBRE DEL JOCKEY ES ",s1(I)
| | | | | Escribir "EL NOMBRE DEL CABALLO ES ",s2(I)
| | | | FinSi
| | | FinPara
| | | Escribir "DESEA SEGUIR AQUI"
| | | Leer L
| | Fin Si
| | Hasta Que L="NO"
| | Limpiar Pantalla
| FinPara
//==================================================================
| Escribir "RESULTADOS DEL TORNEO";
| Limpiar Pantalla
| Escribir "PARA DETERMINAR EL GANADOR DEL TORNEO ESCRIBA EL COMPETIDOR QUE
HIZO MAS CARRERAS"
| Leer I
| Escribir "EL GANADOR DEL TORNEO ES EL COMPETIDOR ",I
| Escribir "EL NOMBRE DEL JOCKEY ES ",s1(I)
| Escribir "EL NOMBRE DEL CABALLO ES ",s2(I)
FinAlgoritmo
============
PUNTO 4
============

Algoritmo Registro RESS


/*
DICCIONARIO

s1<- Nombre de Serie


s2<- Peso
s3<- Sexo
s4<- Edad

*/
Cadena s1[100]
Real s2
Cadena s3[100]
Entero s4
Fin Registro
//==================================================================
Arreglo[100] de Cadena[100] SOBREPESO
Arreglo[100] de RESS PRODUCTO
Entero I,CONT, Aleatorio
Inicio
Para I<-1 Hasta 100 Haga
Escribir "REGISTRO DE RES No.",I
Llamar nueva_linea
Escribir "DECLARE EL NOMBRE DE SERIE DE LA RES"
Lea PRODUCTO[I].s1
Llamar nueva_linea
Escribir "INGRESE EL SEXO DE LA RES";
Escribir "SI ES HEMBRA(1) O MACHO(2)";
Leer PRODUCTO[I].s3;
Llamar nueva_linea
Escribir "INGRESE EL PESO DE LA RES ";
Lea PRODUCTO[I].s2
Llamar nueva_linea
PRODUCTO[I].s2<-Aleatorio()*10
Fin Para
//==================================================================
Para I<-1 Hasta 100 Hacer
Escribir "DATOS OBTENIDOS DE LA RES NUMERO ",I
Llamar nueva_linea
Escribir "NOMBRE DE SERIE: ",PRODUCTO[I].s1
Llamar nueva_linea
Si PRODUCTO[I].s3="1" Entonces
Escriba "SU RES ES HEMBRA"
Sino
Escriba "SU RES ES MACHO"
Fin Si
Llamar nueva_linea
Escribir "PESO DE LA RES: ",PRODUCTO[I].s2
Llamar nueva_linea
Si PRODUCTO[I].s4=0 Entonces
PRODUCTO[I].s4<-Aleatorio()*10
Escribir "SU EDAD ES ",PRODUCTO[I].s4
Sino
Escribir "SU EDAD ES ",PRODUCTO[I].s4
Fin Si
Llamar nueva_linea
Fin Para
/=================================================================
Para I<-1 Hasta 100 Haga
Si PRODUCTO[I].s3="1" Entonces
Si PRODUCTO[I].s2>40 Entonces
CONT<-CONT+1
Llamar nueva_linea
SOBREPESO[I]<-PRODUCTO[I].s1
Fin Si
Sino
Fin Si
Fin Para
Si CONT>0 Entonces
Escriba "LISTA DE VACAS CON SOBREPESO: "
Para I<-1 Hasta 100 Hacer
LLamar nueva_linea
Escriba SOBREPESO[I]
Fin Para
Fin Si
Fin

También podría gustarte