Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROCEDURE ImprimirTotalesPorArticulo( VAR matrizNegocioArticulo : tm_Ventas );
- VAR
- articulo : INTEGER;
- negocio : INTEGER;
- totalArticulo : INTEGER;
- BEGIN
- {*
- matrizNegocioArticulo tiene la siguiente representación:
- Fila = nro de negocio
- Columna = nro de articulo
- *}
- {*
- Recorro por Columna ( Articulo en este caso )
- Luego por Fila ( Negocio )
- Acumulo lo vendido
- Mostrar Resultado
- *}
- {*Con este for voy tomando los articulos para obtener su total*}
- FOR articulo := 1 TO _CANTIDAD_ARTICULOS DO
- BEGIN
- {*Dejo fijo el articulo*}
- totalArticulo := 0;
- {*Con este tomo por negocio*}
- FOR negocio := 1 TO _CANTIDAD_NEGOCIOS_ DO
- BEGIN
- {*Lo único que queda es acumular la cantidad vendida en el negocio para el articulo*}
- totalArticulo := totalArticulo + matrizNegocioArticulo[ negocio, articulo ];
- END;
- {*Imprimo el resultado para el articulo en cuestion*}
- writeln( 'articulo: ', articulo, ' total vendido:', totalArticulo );
- END;
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement