70 lines
1.6 KiB
ObjectPascal
70 lines
1.6 KiB
ObjectPascal
uses sysutils;
|
|
|
|
type
|
|
CostoArrayRow = array[1..3] of double;
|
|
CantidadArrayRow = array[1..4] of Int64;
|
|
CostoArray = array[1..3] of CostoArrayRow;
|
|
CantidadArray = array[1..3] of CantidadArrayRow;
|
|
|
|
const
|
|
ESTACIONES : array[1..4] of string = ('Verano', 'Otoño', 'Invierno', 'Primavera');
|
|
ARTICULOS : array[1..3] of string = ('A', 'B', 'C');
|
|
COSTES : array[1..3] of string = ('Costo de materiales', 'Mano de obra', 'Otros gastos');
|
|
|
|
procedure printCantidad(cantidad: CantidadArray);
|
|
var
|
|
i, j: Int64;
|
|
begin
|
|
for i := 1 to Length(ESTACIONES) do
|
|
write(#9 + ESTACIONES[i]);
|
|
write(#10);
|
|
for i := 1 to Length(cantidad) do
|
|
begin
|
|
write(ARTICULOS[i]);
|
|
for j := 1 to Length(cantidad[i]) do
|
|
begin
|
|
write(#9 + IntToStr(cantidad[i][j]));
|
|
end;
|
|
write(#10);
|
|
end;
|
|
end;
|
|
|
|
procedure printCosto(costo: CostoArray);
|
|
var
|
|
i, j: Int64;
|
|
begin
|
|
for i := 1 to Length(ARTICULOS) do
|
|
write(#9 + ARTICULOS[i]);
|
|
write(#10);
|
|
for i := 1 to Length(costo) do
|
|
begin;
|
|
write(COSTES[i]);
|
|
for j := 1 to Length(costo[i]) do
|
|
begin
|
|
write(#9 + FloatToStr(costo[i][j]));
|
|
end;
|
|
write(#10);
|
|
end;
|
|
end;
|
|
|
|
procedure printTables(costo: CostoArray; cantidad: CantidadArray);
|
|
begin
|
|
printCosto(costo);
|
|
printCantidad(cantidad);
|
|
end;
|
|
|
|
var
|
|
costo: CostoArray;
|
|
cantidad: CantidadArray;
|
|
i, j: Int64;
|
|
|
|
begin
|
|
for i := 1 to 3 do
|
|
for j := 1 to 3 do
|
|
costo[i][j] := 0;
|
|
for i := 1 to 3 do
|
|
for j := 1 to 4 do
|
|
cantidad[i][j] := 0;
|
|
printTables(costo, cantidad);
|
|
end.
|