Pues otro programa que me toco hacer en el bachillerato fue un programa amortizador (que sinceramente nunca entend铆 que es la amortizaci贸n jeje pero pues

simplemente segu铆 las instrucciones del profesor Pedro Granero Mundo que es muy bueno), y funciona muy bien :) por el momento a mi no me sirve de mucho

ya que no tengo dinero, lo que provoca que no tenga que realizar cuentas ni manejo de dinero pero igual y a alguien le puede servir jeje..
Este programa luce de esta manera:

Aqu铆 esta el c贸digo fuente:

DELPHI:
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls, ExtCtrls, Grids, math;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     deuda: TEdit;
  12.     interes: TEdit;
  13.     tiempo: TEdit;
  14.     salir: TButton;
  15.     limpiar: TButton;
  16.     amortizacion: TButton;
  17.     Label1: TLabel;
  18.     Label2: TLabel;
  19.     Label4: TLabel;
  20.     Label3: TLabel;
  21.     it: TLabel;
  22.     rg1: TRadioGroup;
  23.     rg2: TRadioGroup;
  24.     m: TStringGrid;
  25.     procedure FormActivate(Sender: TObject);
  26.     procedure salirClick(Sender: TObject);
  27.     procedure limpiarClick(Sender: TObject);
  28.     procedure deudaChange(Sender: TObject);
  29.     procedure interesChange(Sender: TObject);
  30.     procedure tiempoChange(Sender: TObject);
  31.     procedure rg1Click(Sender: TObject);
  32.     procedure rg2Click(Sender: TObject);
  33.     procedure amortizacionClick(Sender: TObject);
  34.   private
  35.     { Private declarations }
  36.   public
  37.     { Public declarations }
  38.   end;
  39.  
  40. var
  41.   Form1: TForm1;
  42.   fil,col,tf:integer;
  43.   pc,mes,si,i,sf,pm,deu,int,ti,im:real;
  44.  
  45. implementation
  46.  
  47. {$R *.dfm}
  48.  
  49. procedure TForm1.FormActivate(Sender: TObject);
  50. begin
  51.  {Introducimos nombre de las columnas}
  52.  m.Cells[0,0]:='Mes';
  53.  m.Cells[1,0]:='Saldo Inicial';
  54.  m.Cells[2,0]:='Pago Capital';
  55.  m.Cells[3,0]:='Intereses';
  56.  m.Cells[4,0]:='Saldo Final';
  57.  m.Cells[5,0]:='Pago del Mes';
  58.  
  59.  {Limpiamos las demas celdas}
  60.  for fil:=1 to m.rowcount -1 do
  61.   begin
  62.    for col:=0 to 5 do
  63.      m.cells[col,fil]:='';
  64.   end;
  65.  
  66.  {Inicializamos matriz}
  67.  m.RowCount:=2
  68. end;
  69.  
  70. procedure TForm1.salirClick(Sender: TObject);
  71. begin
  72. form1.Close;
  73. end;
  74.  
  75. procedure TForm1.limpiarClick(Sender: TObject);
  76. begin
  77.  {Limpiamos todo}
  78.  deuda.text:='';
  79.  interes.Text:='';
  80.  tiempo.Text:='';
  81.  amortizacion.Enabled:=false;
  82.  limpiar.Enabled:=false;
  83.  rg1.ItemIndex:=-1;
  84.  rg2.ItemIndex:=-1;
  85.  it.Caption:='';
  86.  deuda.SetFocus;
  87.  
  88.  {Limpiamos variables}
  89.  fil:=0;
  90.  col:=0;
  91.  tf:=0;
  92.  pc:=0;
  93.  mes:=0;
  94.  si:=0;
  95.  i:=0;
  96.  sf:=0;
  97.  pm:=0;
  98.  deu:=0;
  99.  int:=0;
  100.  ti:=0;
  101.  im:=0;
  102.  
  103.  {Limpiamos las demas celdas}
  104.  for fil:=1 to m.rowcount -1 do
  105.   begin
  106.    for col:=0 to 5 do
  107.      m.cells[col,fil]:='';
  108.   end;
  109.  
  110.  {Inicializamos matriz}
  111.  m.RowCount:=2
  112. end;
  113.  
  114. procedure TForm1.deudaChange(Sender: TObject);
  115. begin
  116.  {condicion pora limpiar}
  117.  if (deuda.text<>'') or (interes.text<>'') or (tiempo.text<>'')
  118.  or (rg1.itemindex>-1) or (rg2.itemindex>-1) then
  119.    limpiar.Enabled:=true
  120.  else
  121.    limpiar.Enabled:=false;
  122.  
  123.  {condicion para amortizar}
  124.  if (deuda.text<>'') and (interes.text<>'') and (tiempo.text<>'')
  125.  and (rg1.itemindex>-1) and (rg2.itemindex>-1) then
  126.    amortizacion.Enabled:=true
  127.  else
  128.    amortizacion.Enabled:=false;
  129. end;
  130.  
  131. procedure TForm1.interesChange(Sender: TObject);
  132. begin
  133.  {condicion pora limpiar}
  134.  if (deuda.text<>'') or (interes.text<>'') or (tiempo.text<>'')
  135.  or (rg1.itemindex>-1) or (rg2.itemindex>-1) then
  136.    limpiar.Enabled:=true
  137.  else
  138.    limpiar.Enabled:=false;
  139.  
  140.  {condicion para amortizar}
  141.  if (deuda.text<>'') and (interes.text<>'') and (tiempo.text<>'')
  142.  and (rg1.itemindex>-1) and (rg2.itemindex>-1) then
  143.    amortizacion.Enabled:=true
  144.  else
  145.    amortizacion.Enabled:=false;
  146. end;
  147.  
  148. procedure TForm1.tiempoChange(Sender: TObject);
  149. begin
  150.  {condicion pora limpiar}
  151.  if (deuda.text<>'') or (interes.text<>'') or (tiempo.text<>'')
  152.  or (rg1.itemindex>-1) or (rg2.itemindex>-1) then
  153.    limpiar.Enabled:=true
  154.  else
  155.    limpiar.Enabled:=false;
  156.  
  157.  {condicion para amortizar}
  158.  if (deuda.text<>'') and (interes.text<>'') and (tiempo.text<>'')
  159.  and (rg1.itemindex>-1) and (rg2.itemindex>-1) then
  160.    amortizacion.Enabled:=true
  161.  else
  162.    amortizacion.Enabled:=false;
  163. end;
  164.  
  165. procedure TForm1.rg1Click(Sender: TObject);
  166. begin
  167.  {condicion pora limpiar}
  168.  if (deuda.text<>'') or (interes.text<>'') or (tiempo.text<>'')
  169.  or (rg1.itemindex>-1) or (rg2.itemindex>-1) then
  170.    limpiar.Enabled:=true
  171.  else
  172.    limpiar.Enabled:=false;
  173.  
  174.  {condicion para amortizar}
  175.  if (deuda.text<>'') and (interes.text<>'') and (tiempo.text<>'')
  176.  and (rg1.itemindex>-1) and (rg2.itemindex>-1) then
  177.    amortizacion.Enabled:=true
  178.  else
  179.    amortizacion.Enabled:=false;
  180. end;
  181.  
  182. procedure TForm1.rg2Click(Sender: TObject);
  183. begin
  184.  {condicion pora limpiar}
  185.  if (deuda.text<>'') or (interes.text<>'') or (tiempo.text<>'')
  186.  or (rg1.itemindex>-1) or (rg2.itemindex>-1) then
  187.    limpiar.Enabled:=true
  188.  else
  189.    limpiar.Enabled:=false;
  190.  
  191.  {condicion para amortizar}
  192.  if (deuda.text<>'') and (interes.text<>'') and (tiempo.text<>'')
  193.  and (rg1.itemindex>-1) and (rg2.itemindex>-1) then
  194.    amortizacion.Enabled:=true
  195.  else
  196.    amortizacion.Enabled:=false;
  197. end;
  198.  
  199. procedure TForm1.amortizacionClick(Sender: TObject);
  200. begin
  201. {inicializamos todo}
  202.    deu:=strtofloat(deuda.Text);
  203.    int:=strtofloat(interes.text);
  204.    ti:=strtofloat(tiempo.text);
  205.  
  206. {calculamos interes mensual}
  207.    if rg1.itemindex=0 then
  208.      im:=int/100
  209.    else
  210.      im:=(int/100)/12;
  211.  
  212. {primer columna}
  213.    if rg2.itemindex=0 then
  214.      mes:=ti
  215.    else
  216.      mes:=ti*12;
  217.  
  218. {Colocamos total de filas}
  219.     if rg2.itemindex=0 then
  220.       tf:=strtoint(tiempo.text)
  221.    else
  222.       tf:=strtoint(tiempo.text)*12;
  223.  
  224.    m.RowCount:=tf +1;
  225.    for fil:=1 to tf do
  226.      m.cells[0,fil]:=floattostr(roundto(fil, -2));
  227.  
  228. {tercera columna}
  229.    pc:=deu/mes;
  230.    for fil:=1 to tf do
  231.      m.cells[2,fil]:=floattostr(roundto(pc, -2));
  232.  
  233. {segunda columna}
  234.    si:=deu+pc;
  235.    for fil:=1 to tf do
  236.      begin
  237.      si:=si-pc;
  238.      m.Cells[1,fil]:=floattostr(roundto(si, -2));
  239.      end;
  240.  
  241. {quinta columna}
  242.    sf:=deu;
  243.    for fil:=1 to tf do
  244.      begin
  245.      sf:=sf-pc;
  246.      m.Cells[4,fil]:=floattostr(roundto(sf, -2));
  247.      end;
  248.  
  249. {cuarta columna}
  250.    si:=deu+pc;
  251.    for fil:=1 to tf do
  252.      begin
  253.      si:=si-pc;
  254.      i:=si*im;
  255.      m.Cells[3,fil]:=floattostr(roundto(i, -2));
  256.      end;
  257.  
  258. {sexta columna}
  259.    pc:=deu/mes;
  260.    si:=deu+pc;
  261.    for fil:=1 to tf do
  262.      begin
  263.      si:=si-pc;
  264.      i:=si*im;
  265.      pm:=pc+i;
  266.      m.Cells[5,fil]:=floattostr(roundto(pm, -2));
  267.      end;
  268.  
  269. {interes total}
  270.    ti:=0;
  271.    for fil:=1 to tf do
  272.    ti:=ti+strtofloat(m.Cells[3,fil]);
  273.    it.Caption:=floattostr(roundto(ti,-2));
  274.  
  275. end;
  276.  
  277. end.

Bueno, el codigo fuente es por si te interesa saber como esta desarrollado el programa.. Pero si lo que te interesa es Ejecutarlo y usarlo para calcular

la amortizaci贸n de tus deudas pues descarga el siguiente archivo .zip y ejecuta el archivo "amortizacion.exe" para poder usarlo :P, no es necesario

instalarlo...

Archivo