Essays.club - Ensayos gratis, notas de cursos, notas de libros, tareas, monografías y trabajos de investigación
Buscar

Algoritmos y programación

Enviado por   •  26 de Diciembre de 2018  •  1.580 Palabras (7 Páginas)  •  283 Visitas

Página 1 de 7

...

opcion = 0

Fin(PARA)

Fin (SI)

SI opcion == 3

PARA i DESDE 1 HASTA municipios CON VARIACIÓN +1

tf = suma_una_fila(costos,100,i)

ESCRIBA(“Presupuesto total proyectos”, tf)

ESCRIBA(“En el municipio”, i)

Fin(PARA)

opcion = 0

Fin(SI)

SI opcion ==4

tf = suma_una_matriz(costos,100,municipios)

ESCRIBA(“Total de dinero que va invertir la empresa en todos los proyectos”, tf )

opcion = 0;

Fin(SI)

SI opcion == 5

PARA i HASTA municipios CON VARIACION+1

tf = suma_una_fila_tipos(tipos,100,i);

ESCRIBA(“Total de proyectos por municipio” , tf)

ESCRIBA(“En el municipio”, i);

Fin(PARA)

opcion = 0

Fin(SI)

SI opcion == 6

tf = suma_una_matriz_proyecto1(costos,100,municipios,tipos)

proy1 = tf

tf = suma_una_matriz_tipo1(tipos,100,municipios);

b = tf

c = proy1/b

Costo promedio proyecto tipo 1. %g\n', c)

tf = suma_una_matriz_proyecto2(costos,100,municipios,tipos)

proy1 = tf

tf = suma_una_matriz_tipo2(tipos,100,municipios)

b = tf;

c = proy1/b;

ESCRIBA(“Costo promedio proyecto tipo 2.”, c)

opcion = 0

Fin(SI)

SI opcion == 7

PARA i HASTA municipios CON VARIACION +1

tf = suma_una_fila(costos,100,i)

a = tf

tf = suma_una_fila_tipos(tipos,100,i)

b = tf

c = a/b

ESCRIBA(“Costo promedio proyectos” , c)

ESCRIBA(“En el municipio” , i)

opcion = 0

Fin(PARA)

Fin(SI)

Fin (MIENTRAS)

FIN

Fin(proyectos)

Explicación de variables subprogramas:

tf: en todos los subprogramas es una variable acumuladora que sirve para almacenar el tipo de información requerido y varia según la necesidad

i, j, n:En todos los subprogramas son variables que sirven para almacenar organizan las marices por filas y columnas.

SEUPDOCODIGO SUBPROGRAMAS

SUBPROGRAMA 1: TIENE DOS PARTES:

Void suma_una_matriz_proyecto1(mat, n, fila, mat1)

Variables:

tf,i, j:enteros

INICIO

tf = 0

PARA i DESDE 1 HASTA fila CON VARIACION +1

PARA j DESDE 1 HASTA n CON VARIACION+1

SI mat1(i,j) == 1

tf = tf + mat(i, j)

Fin(SI)

Fin(PARA)

Fin(PARA)

FIN

Fin(suma_una_matriz_proyecto1)

Void suma_una_matriz_proyecto2(mat, n, fila, mat1)

Variables:

tf,i, j:enteros

INICIO

tf = 0

PARA i DESDE 1 HASTA fila CON VARIACION +1

PARA j DESDE 1 HASTA n CON VARIACION+1

SI mat1(i,j) == 1

tf = tf + mat(i, j)

Fin(SI)

Fin(PARA)

Fin(PARA)

FIN

Fin(suma_una_matriz_proyecto2)

SUBPROGRAMA 2: TIENE DOS PARTES

Void suma_una_fila1(mat, n, fila, mat1)

Variables:

tf,fila, j:enteros

INICIO

tf = 0

PARA j DESDE 1 HASTA n CON VARIACION +1

SI mat1(fila,j) == 1

tf = tf + mat(fila, j)

Fin(SI)

Fin(PARA)

FIN

Fin(suma_una_fila1)

Void suma_una_fila2(mat, n, fila, mat1)

Variables:

...

Descargar como  txt (13 Kb)   pdf (71.5 Kb)   docx (27.1 Kb)  
Leer 6 páginas más »
Disponible sólo en Essays.club