Browse Source

Solving more errors

master
sergiotarxz 2 months ago
parent
commit
2a1f78114a
Signed by: sergiotarxz GPG Key ID: E5903508B6510AC2
1 changed files with 16 additions and 16 deletions
  1. +16
    -16
      ejercicio3.pas

+ 16
- 16
ejercicio3.pas View File

@ -1,7 +1,7 @@
uses sysutils,crt;
const
CATEGORIAS : array[1..4] of string = (
CATEGORIAS : array[0..3] of string = (
'Junior', 'Senior',
'Rockstar', 'Mentor'
);
@ -11,15 +11,15 @@ const
'Awen', 'Sinno', 'Xiao', 'Josefina',
'Mercedes', 'Maria', 'Ainnoha'
);
DIAS_DE_LA_SEMANA : array[1..6] of string = (
DIAS_DE_LA_SEMANA : array[0..5] of string = (
'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'
);
type
ArrayHorasObrero = array[1..6] of int64;
ArrayHorasObrero = array[0..5] of int64;
ArrayHorasObreros = array of ArrayHorasObrero;
EnroqueArray = array of int64;
PagoPorCategoria = array[1..4] of double;
PagoPorCategoria = array[0..3] of double;
function GenerarEnroque(): EnroqueArray;
var
@ -37,9 +37,9 @@ var
begin
SetLength(GenerarHorasObreros, NUMERO_OBREROS);
for i := 0 to Length(GenerarHorasObreros) do
for i := 0 to Length(GenerarHorasObreros) - 1 do
begin
for j := 1 to Length(GenerarHorasObreros[i]) do
for j := 0 to Length(GenerarHorasObreros[i]) - 1 do
begin
if j = 6 then
GenerarHorasObreros[i][j] := Random(6)
@ -54,7 +54,7 @@ var
i : int64;
begin
for i := 1 to Length(GenerarPagoPorCategoria) do
for i := 0 to Length(GenerarPagoPorCategoria) - 1 do
GenerarPagoPorCategoria[i] := Random() * 1000;
end;
@ -72,7 +72,7 @@ var
total_pagado : double = 0;
begin
for i := 1 to Length(horas_por_dia_de_la_semana) do
for i := 0 to Length(horas_por_dia_de_la_semana) - 1 do
horas_por_dia_de_la_semana[i] := 0;
writeln('Horas trabajadas obreros.');
@ -80,19 +80,19 @@ begin
writeln('');
write('Nombre Obrero ');
for i := 1 to Length(DIAS_DE_LA_SEMANA) do
for i := 0 to Length(DIAS_DE_LA_SEMANA) - 1 do
write(DIAS_DE_LA_SEMANA[i] + ' ');
write('Total Obrero ');
write('Categoría ');
write('Monto a cancelar');
writeln('');
for i := 0 to Length(array_horas_obreros) do
for i := 0 to Length(array_horas_obreros) - 1 do
begin
write(OBREROS[i] + ' ');
total_horas_obrero := 0;
for j := 1 to Length(array_horas_obreros[i]) do
for j := 0 to Length(array_horas_obreros[i]) - 1 do
begin
if j = 6 then
if j = 5 then
begin
total_horas_obrero += (array_horas_obreros[i][j] * 1.55);
horas_por_dia_de_la_semana[j] += array_horas_obreros[i][j] * 1.55;
@ -108,7 +108,7 @@ begin
writeln(' ');
end;
write('Total día ');
for i := 1 to Length(horas_por_dia_de_la_semana) do
for i := 0 to Length(horas_por_dia_de_la_semana) - 1 do
begin
write(horas_por_dia_de_la_semana[i]:8:2); write(' ');
end;
@ -119,11 +119,11 @@ begin
writeln('');
write('CATEGORÍA ');
for i := 1 to Length(CATEGORIAS) do
for i := 0 to Length(CATEGORIAS) - 1 do
write(CATEGORIAS[i] + ' ');
writeln(' ');
write('(PAGO UM) ');
for i := 1 to Length(pago_por_categoria) do
for i := 0 to Length(pago_por_categoria) - 1 do
begin
write(pago_por_categoria[i]:8:2); write(' ');
end;
@ -132,7 +132,7 @@ begin
dia_mas_trabajado := 1;
dia_menos_trabajado := 1;
for i := 1 to Length(horas_por_dia_de_la_semana) do
for i := 0 to Length(horas_por_dia_de_la_semana) - 1 do
begin
write(horas_por_dia_de_la_semana[dia_mas_trabajado]:8:2); write(' ');
write(horas_por_dia_de_la_semana[dia_menos_trabajado]:8:2); write(' ');


Loading…
Cancel
Save