Elabore um programa para cadastrar três raças de cães. Para cada raça crie um controle para saber quantos cães foram atendidos no mês de Dezembro, quantos foram atendidos no mês de Janeiro, quantos foram atendidos no mês de Fevereiro e quantos foram atendidos no mês de Março. Ao final, somar o total de atendimentos de cada raça e o total geral.
Caso não esteja conseguindo completar o exercício deixe sua dúvida.
ResponderExcluirsinara
ResponderExcluirProgram caes ;
type
matriz= array[1..3,1..4] of integer;
vetorA= array [1..3] of string;
vetorB= array[1..3] of integer;
var
mes:matriz;
rc:vetorA;
soma:vetorB;
i,j,totalg:integer;
Begin
totalg:=0;
writeln('raca');
For I:= 1 to 4 do
begin
soma[I] := 0;
readln(rc[i]);
For J:= 1 to 4 do
begin
readln(mes[i,j]);
soma[i]:=soma[i]+mes[i,j];
end;
writeln(soma[i]);
totalg:=totalg+soma[i];
end;
writeln('totalg');
readln;
End.
gilberson
ResponderExcluirProgram caes ;
type
matriz= array[1..3,1..4] of integer;
vetorA= array [1..3] of string;
vetorB= array[1..3] of integer;
var
mes:matriz;
rc:vetorA;
soma:vetorB;
i,j,totalg:integer;
Begin
totalg:=0;
writeln('raca');
For I:= 1 to 4 do
begin
soma[I] := 0;
readln(rc[i]);
For J:= 1 to 4 do
begin
readln(mes[i,j]);
soma[i]:=soma[i]+mes[i,j];
end;
writeln(soma[i]);
totalg:=totalg+soma[i];
end;
writeln('totalg');
readln;
End.
Bianca*
ResponderExcluirProgram Pzim ;
type
vetor=array [1..3] of string;
matriz= array [1..3,1..4] of integer;
vetors=array [1..3] of integer;
var
raca:vetor;
atendimento:matriz;
somad:integer;
somaj:integer;
somaf:integer;
somam:integer;
i,c:integer;
soma:vetors;
totalgeral: integer;
begin
totalgeral:= 0 ;
for I:=1 to 3 do
begin
gotoxy(3,3);
writeln(' Raça:') ;
gotoxy(3,4);
writeln(' Raça:');
gotoxy(3,5);
writeln(' Raça:');
gotoxy(19,1);
writeln('Digite atendimento');
gotoxy(18,2);
writeln(' Dez');
gotoxy(24,2);
writeln('Jan');
gotoxy(30,2);
writeln('Fev');
gotoxy(36,2);
writeln('Mar');
gotoxy(12,i+2);
readln(raca[i]);
for c:= 1 to 4 do
begin
gotoxy(6*c+12,i+2);
readln(atendimento[i,c]);
soma[I]:=soma[I]+atendimento[I,c];
gotoxy(42,2);
writeln('Total p/ Raça');
end;
gotoxy(42,2+i);
writeln(soma[i]);
totalgeral:= totalgeral+ soma[i];
end;
gotoxy(15,8);
writeln('Total de atendimento: ', totalgeral);
readln;
end.
Daniella Lavinas
ResponderExcluirProgram Cao ;
type
vetor=array [1..3] of string;
matriz= array [1..3,1..4] of integer;
vetors=array [1..3] of integer;
var
raca:vetor;
atendimento:matriz;
somad:integer;
somaj:integer;
somaf:integer;
somam:integer;
i,c:integer;
soma:vetors;
totalgeral: integer;
begin
totalgeral:= 0 ;
for I:=1 to 3 do
begin
gotoxy(3,3);
writeln(' Raça:') ;
gotoxy(3,4);
writeln(' Raça:');
gotoxy(3,5);
writeln(' Raça:');
gotoxy(19,1);
writeln('Digite atendimento');
gotoxy(18,2);
writeln(' Dez');
gotoxy(24,2);
writeln('Jan');
gotoxy(30,2);
writeln('Fev');
gotoxy(36,2);
writeln('Mar');
gotoxy(12,i+2);
readln(raca[i]);
for c:= 1 to 4 do
begin
gotoxy(6*c+12,i+2);
readln(atendimento[i,c]);
soma[I]:=soma[I]+atendimento[I,c];
gotoxy(42,2);
writeln('Total p/ Raça');
end;
gotoxy(42,2+i);
writeln(soma[i]);
totalgeral:= totalgeral+ soma[i];
end;
gotoxy(15,8);
writeln('Total de atendimento: ', totalgeral);
readln;
end.