Anexa 1
PROGRAME PE CALCULATOR
Programe de calcul pentru plãti esalonate
Programul CEC99
pentru determinarea valorilor finale si actuale a plãtilor esalonate cu dobândã compusã.

program cec99;
uses crt;
type vec=array[1..100] of real;
label a1,a2,a3,a4,a5,sff,anticip;
var n,i,j,sf,t1,t2,t3,t4,t5,p,r,x,y:integer;
s,d,p1,a,f:real;
ss,pp:vec;
begin
 sf:=0;
 repeat
  clrscr;
  gotoxy(2,2);
  write('Calculul platilor periodice cu dobânzi compuse');
  gotoxy(2,3);
  write('================================');
  gotoxy(2,4);
  write('Tastati 0 pentru iesire!');
  t1:=0; t2:=0; t3:=0; t4:=0; t5:=0; r:=0;
  a1:
 gotoxy(2,6);
  write('Plati variabile   (1) sau constante  (2) | Ce alegeti? (1/2/0): '); read(t1);
  if (t1=0) then halt; if not ((t1=1)or(t1=2)) then goto a1;
  a2:
  gotoxy(2,7);
  write('Plati posticipate (1) sau anticipate (2) | Ce alegeti? (1/2/0): '); read(t2);
  if (t2=0) then halt; if not ((t2=1)or(t2=2)) then goto a2;
  a3:
  gotoxy(2,8);
  write('Plati temporare   (1) sau continue   (2) | Ce alegeti? (1/2/0): '); read(t3);
  if (t3=0) then halt; if not ((t3=1)or(t3=2)) then goto a3;
  a4:
  gotoxy(2,9);
  write('Plati imediate    (1) sau amânate    (2) | Ce alegeti? (1/2/0): '); read(t4);
  if (t4=0) then halt; if not ((t4=1)or(t4=2)) then goto a4;
  a5:
  gotoxy(2,10);
  write('Dobânda variabila (1) sau constanta  (2) | Ce alegeti? (1/2/0): '); read(t5);
  if (t5=0) then halt; if not ((t5=1)or(t5=2)) then goto a5;
  if not ((t1=1)and(t2=1)and(t3=1)and(t4=1)and(t5=1)or
          (t1=1)and(t2=1)and(t3=1)and(t4=1)and(t5=2)or
          (t1=2)and(t2=1)and(t3=1)and(t4=1)and(t5=1)or
          (t1=2)and(t2=1)and(t3=1)and(t4=1)and(t5=2)or
          (t1=1)and(t2=1)and(t3=1)and(t4=2)and(t5=1)or
          (t1=1)and(t2=1)and(t3=1)and(t4=2)and(t5=2)or
          (t1=2)and(t2=1)and(t3=1)and(t4=2)and(t5=1)or
          (t1=2)and(t2=1)and(t3=1)and(t4=2)and(t5=2)or
          (t1=2)and(t2=1)and(t3=2)and(t4=1)and(t5=2)or
          (t1=2)and(t2=1)and(t3=2)and(t4=2)and(t5=2)or
          (t1=1)and(t2=2)and(t3=1)and(t4=1)and(t5=1)or
          (t1=1)and(t2=2)and(t3=1)and(t4=1)and(t5=2)or
          (t1=2)and(t2=2)and(t3=1)and(t4=1)and(t5=1)or
          (t1=2)and(t2=2)and(t3=1)and(t4=1)and(t5=2)or
          (t1=1)and(t2=2)and(t3=1)and(t4=2)and(t5=1)or
          (t1=1)and(t2=2)and(t3=1)and(t4=2)and(t5=2)or
          (t1=2)and(t2=2)and(t3=1)and(t4=2)and(t5=1)or
          (t1=2)and(t2=2)and(t3=1)and(t4=2)and(t5=2)or
          (t1=2)and(t2=2)and(t3=2)and(t4=1)and(t5=2)or
          (t1=2)and(t2=2)and(t3=2)and(t4=2)and(t5=2)) then goto sff;
  writeln; writeln;
  if (t1=1)and(t2=1)and(t3=1)and(t4=1)and(t5=1) then
    write('      <Plati variabile posticipate temporare imediate cu dobânda variabila>');
  if (t1=1)and(t2=1)and(t3=1)and(t4=1)and(t5=2) then
    write('      <Plati variabile posticipate temporare imediate cu dobânda constanta>');
  if (t1=2)and(t2=1)and(t3=1)and(t4=1)and(t5=1) then
    write('      <Plati constante posticipate temporare imediate cu dobânda variabila>');
  if (t1=2)and(t2=1)and(t3=1)and(t4=1)and(t5=2) then
    write('      <Plati constante posticipate temporare imediate cu dobânda constanta>');
  if (t1=1)and(t2=1)and(t3=1)and(t4=2)and(t5=1) then
    write('      <Plati variabile posticipate temporare amânate cu dobânda variabla>');
  if (t1=1)and(t2=1)and(t3=1)and(t4=2)and(t5=2) then
    write('      <Plati variabile posticipate temporare amânate cu dobânda constanta>');
  if (t1=2)and(t2=1)and(t3=1)and(t4=2)and(t5=1) then
    write('      <Plati constante posticipate temporare amânate cu dobânda variabila>');
  if (t1=2)and(t2=1)and(t3=1)and(t4=2)and(t5=2) then
    write('      <Plati constante posticipate temporare amânate cu dobânda constanta>');
  if (t1=2)and(t2=1)and(t3=2)and(t4=1)and(t5=2) then
    write('      <Plati constante posticipate continue imediate cu dobânda constanta>');
  if (t1=2)and(t2=1)and(t3=2)and(t4=2)and(t5=2) then
    write('      <Plati constante posticipate continue amânate cu dobânda constanta>');
  if (t1=1)and(t2=2)and(t3=1)and(t4=1)and(t5=1) then
    write('      <Plati variabile anticipate temporare imediate cu dobânda variabila>');
  if (t1=1)and(t2=2)and(t3=1)and(t4=1)and(t5=2) then
    write('      <Plati variabile anticipate temporare imediate cu dobânda constanta>');
  if (t1=2)and(t2=2)and(t3=1)and(t4=1)and(t5=1) then
    write('      <Plati constante anticipate temporare imediate cu dobânda variabila>');
  if (t1=2)and(t2=2)and(t3=1)and(t4=1)and(t5=2) then
    write('      <Plati constante anticipate temporare imediate cu dobânda constanta>');
  if (t1=1)and(t2=2)and(t3=1)and(t4=2)and(t5=1) then
    write('      <Plati variabile anticipate temporare amânate cu dobânda variabla>');
  if (t1=1)and(t2=2)and(t3=1)and(t4=2)and(t5=2) then
    write('      <Plati variabile anticipate temporare amânate cu dobânda constanta>');
  if (t1=2)and(t2=2)and(t3=1)and(t4=2)and(t5=1) then
    write('      <Plati constante anticipate temporare amânate cu dobânda variabila>');
  if (t1=2)and(t2=2)and(t3=1)and(t4=2)and(t5=2) then
    write('      <Plati constante anticipate temporare amânate cu dobânda constanta>');
  if (t1=2)and(t2=2)and(t3=2)and(t4=1)and(t5=2) then
    write('      <Plati constante anticipate continue imediate cu dobânda constanta>');
  if (t1=2)and(t2=2)and(t3=2)and(t4=2)and(t5=2) then
    write('      <Plati constante anticipate continue amânate cu dobânda constanta>');
  writeln; writeln;
  {Plati constante posticipate/anticipate continue imediate/amânate cu dobânda constanta}
  if t3=2 then
   begin
    write('Dati suma de plata periodica constanta    : '); readln(s);
    write('Dati dobânda periodica constanta          : '); readln(p);
    f:=s/(p/100);
    if t4=2 then
     begin
      write('Dati numarul de ani (perioade) de amânare : ');
      readln(r);
      d:=1+p/100; p1:=d;
      for  i:=2 to r do p1:=p1*d;
      f:=f/p1;
     end;
    if t2=2 then f:=f*(1+p/100);
    writeln; writeln('  SOLUTIE:');
    writeln('  Valoarea finala  =   INFINIT');
    writeln('  Valoarea actuala = ',f:15:2,' lei');
    readln; readln;
    goto sff;
   end;
  if t2=2 then goto anticip;
  {Plati variabile/constante posticipate temporare imediate/amânate cu dobânda variabila/constanta}
  write('Dati numarul de ani (perioade)            : '); readln(n);
  if t4=2 then
   begin
    write('Dati numarul de ani (perioade) de amânare : ');
    readln(r);
   end;
  for i:=1 to n do begin ss[i]:=0; pp[i]:=0; end;
  if t1=2 then
   begin
    write('Dati suma constanta de plata periodica    : ');
    readln(ss[1]);
    for i:=2 to n do ss[i]:=ss[1];
   end else
   begin
    write('Dati sumele variabile de plata periodica  : ');
    x:=wherex; y:=wherey;
    for i:=1 to n do
     begin
      gotoxy(x,y); write(' Perioada ',i,' = '); write('               ');
      gotoxy(x+14,y); read(ss[i]);
     end;
   end;
  if t5=2 then
   begin
    write('Dati dobânda constanta de plata periodica : ');
    readln(pp[1]);
    for i:=2 to n do pp[i]:=pp[1];
   end else
   begin
    write('Dati dobânzile variabile periodice        : ');
    x:=wherex; y:=wherey;
    for i:=1 to n do
     begin
      gotoxy(x,y); write(' Perioada ',i,' = '); write('               ');
      gotoxy(x+14,y); read(pp[i]);
     end;
   end;
   for i:=1 to n do pp[i]:=1+pp[i]/100;  a:=ss[n];
   for i:=r+1 to n-1 do
    begin
     p1:=1;
     for j:=i+1 to n do p1:=p1*pp[j];
     a:=a+ss[i]*p1;
    end;
   f:=a; a:=0;
   for i:=r+1 to n do
    begin
       p1:=1;
       for j:=1 to i do p1:=p1*pp[j];
       a:=a+ss[i]/p1;
    end;
   writeln; writeln('  SOLUTIE:');
   writeln('  Valoarea finala  = ',f:15:2,' lei');
   writeln('  Valoarea actuala = ',a:15:2,' lei');
   writeln; write('Tastati <Enter>');
   readln; readln;
   goto sff;
 anticip:
  {Plati variabile/constante anticipate temporare imediate/amânate cu dobânda variabila/constanta}
  write('Dati numarul de ani (perioade)            : '); readln(n);
  if t4=2 then
   begin
     write('Dati numarul de ani (perioade) de amânare : ');
     readln(r);
   end;
  for i:=1 to n do begin ss[i]:=0; pp[i]:=0; end;
  if t1=2 then
   begin
     write('Dati suma constanta de plata periodica    : ');
     readln(ss[1]);
     for i:=2 to n do ss[i]:=ss[1];
   end else
   begin
    write('Dati sumele variabile de plata periodica  : ');
    x:=wherex; y:=wherey;
    for i:=1 to n do
     begin
      gotoxy(x,y); write(' Perioada ',i,' = '); write('               ');
      gotoxy(x+14,y); read(ss[i]);
     end;
   end;
  if t5=2 then
   begin
    write('Dati dobânda constanta de plata periodica : ');
    readln(pp[1]);
    for i:=2 to n do pp[i]:=pp[1];
   end else
   begin
    write('Dati dobânzile variabile periodice        : ');
    x:=wherex; y:=wherey;
    for i:=1 to n do
     begin
      gotoxy(x,y); write(' Perioada ',i,' = '); write('               ');
      gotoxy(x+14,y); read(pp[i]);
     end;
   end;
for i:=1 to n do pp[i]:=1+pp[i]/100;  a:=0;
   for i:=r+1 to n do
    begin
     p1:=1;
     for j:=i to n do p1:=p1*pp[j];
     a:=a+ss[i]*p1;
    end;
   f:=a; a:=0;
   for i:=r+1 to n do
    begin
     p1:=1;
     for j:=1 to i-1 do p1:=p1*pp[j];
     a:=a+ss[i]/p1;
    end;
   writeln; writeln('  SOLUTIE:');
   writeln('  Valoarea finala  = ',f:15:2,' lei');
   writeln('  Valoarea actuala = ',a:15:2,' lei');
   writeln; write('Tastati <Enter>');  readln; readln;
 sff:
 until sf=1;
end.

Inapoi                                                                           Inainte
Prima paginã