Necsito meter esto dentro de archivos URGENTE PARA MAÑANA.POR FAVOR AYUDENME!!
Publicado por dani gonzalez (9 intervenciones) el 07/02/2012 02:31:56
program banco_uneg;
uses
crt;
type
cliente = record
cedula : integer;
nombre : string[12];
apellido1 : string[12];
direccion : string[50];
telefono : string[12];
codigo1 : string[6];
cta_aho : string[20];
cta_cte : string[20];
bs_aho : real;
bs_cte : real
end;
var
cuenta : cliente;
procedure Registrar_nuevo_cliente;
var
codigo : string[6];
begin
gotoxy(12,2);write('*** Registrar_nuevo_cliente ***');
gotoxy(12,4);write('Entre Codigo Nuevo Cliente : ');
gotoxy(41,4);readln(codigo);
{aki va un for para recorrer todos los archivos}
if (codigo = cuenta.codigo1) then
begin
gotoxy(12,4);writeln('Este codigo ya se encuentra registrado ');
readkey;
clrscr
end
else
begin
clrscr;
cuenta.codigo1:=codigo;
gotoxy(12,2);write('*** Registrar_nuevo_cliente ***');
gotoxy(12,5);write('Cedula : ');
gotoxy(12,6);write('Nombre : ');
gotoxy(12,7);write('Apellido : ');
gotoxy(12,8);write('Direccion : ');
gotoxy(12,9);write('Telefono : ');
gotoxy(12,10);write('Codigo : ');
gotoxy(26,5);readln(cuenta.cedula);
gotoxy(26,6);readln(cuenta.nombre);
gotoxy(26,7);readln(cuenta.apellido1);
gotoxy(26,8);readln(cuenta.direccion);
gotoxy(26,9);readln(cuenta.telefono);
gotoxy(26,10);writeln(cuenta.codigo1);
writeln;
readkey;
clrscr;
end;
end;
procedure retiro_deposito_saldo;
var
valor,aux : real;
opc : char;
cta : char;
sw : boolean;
begin
sw:=true;
valor:=0.00;
while (sw = true) do
begin
clrscr;
gotoxy(3,2);writeln ('opc 1. depositar');
gotoxy(3,3);writeln ('opc 2. retirar');
gotoxy(3,4);writeln ('opc 3. consultar');
gotoxy(3,5);writeln ('opc 4. salir');
opc := readkey;
clrscr;
case opc of
'1':repeat
clrscr;
gotoxy(3,3);writeln('1.CUENTA DE AHORRO');
gotoxy(3,4);writeln('2.CUENTA CORRIENTE');
gotoxy(3,5);cta:=readkey;
clrscr;
if (cta = '1') then
if (cuenta.cta_aho =' ') then
begin
gotoxy(3,4);writeln('Ud no posee una cuenta de ahorro');
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln ('introduzca el monto');
gotoxy(3,5);read (aux);
clrscr;
if (aux > 0) THEN
cuenta.bs_aho:=cuenta.bs_aho + aux
else
gotoxy(3,4);writeln ('monto invalido');
clrscr;
end
else
if (cta = '2') then
if (cuenta.cta_cte =' ') then
begin
gotoxy(3,4);writeln('Ud no posee una cuenta corriente');
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln ('introduzca el monto');
gotoxy(3,4);read (aux);
clrscr;
if (aux > 0) THEN
cuenta.bs_cte:=cuenta.bs_cte + aux
else
begin
gotoxy(3,4);writeln ('monto invalido');
clrscr;
end
end;
if (cta<>'1')and(cta<>'2') then
begin
clrscr;
gotoxy(3,5);writeln('Opcion invalida. Intente de nuevo');
readkey;
clrscr
end
until (cta='1')or(cta='2');
'2':repeat
clrscr;
gotoxy(3,3);writeln('1.CUENTA DE AHORRO');
gotoxy(3,4);writeln('2.CUENTA CORRIENTE');
gotoxy(3,5);cta:=readkey;
clrscr;
if (cta = '1') then
if (cuenta.cta_aho =' ') then
begin
gotoxy(12,3);writeln('Ud no posee una cuenta de ahorro');
readkey;
clrscr
end
else
begin
gotoxy(12,3);writeln ('introduzca monto a retirar');
gotoxy(12,4);read (aux);
if (aux > cuenta.bs_aho) then
begin
gotoxy(12,5);writeln('No posee saldo suficiente para realizar esta transaccion');
readkey;
clrscr
end
else
if (cuenta.bs_aho=valor) then
begin
gotoxy(12,5);writeln('Saldo Insuficiente, Ud posee un saldo de: ', cuenta.bs_aho:2:2);
readkey;
clrscr
end
else
if (cuenta.bs_aho >= aux) then
cuenta.bs_aho := cuenta.bs_aho - aux
else
gotoxy(3,4);write ('monto invalido');
clrscr
end
else
if (cta = '2') then
if (cuenta.cta_cte =' ') then
begin
gotoxy(12,3);writeln('Ud no posee una cuenta corriente');
readkey;
clrscr
end
else
begin
gotoxy(12,3);writeln ('introduzca monto a retirar');
gotoxy(12,5);readln (aux);
if (cuenta.bs_cte=valor) then
begin
gotoxy(12,5);writeln('Saldo Insuficiente, Ud posee un saldo de: ', cuenta.bs_cte:2:2);
readkey;
clrscr
end
else
if (cuenta.bs_cte >= aux) then
cuenta.bs_cte := cuenta.bs_cte - aux
else
gotoxy(3,4);write ('monto invalido');
clrscr
end;
if (cta<>'1')and(cta<>'2') then
begin
clrscr;
gotoxy(3,5);writeln('Opcion invalida. Intente de nuevo');
readkey;
clrscr
end
until (cta='1')or(cta='2');
'3':repeat
clrscr;
gotoxy(3,3);writeln('1.CUENTA DE AHORRO');
gotoxy(3,4);writeln('2.CUENTA CORRIENTE');
gotoxy(3,5);cta:=readkey;
clrscr;
if (cta = '1') then
if (cuenta.cta_aho =' ') then
begin
gotoxy(12,3);writeln('Ud no posee una cuenta de ahorro');
readkey;
clrscr
end
else
begin
gotoxy(12,3);writeln ('el saldo es ',cuenta.bs_aho:2:2,'Bs');
writeln;
readkey;
clrscr
end
else
if (cta = '2') then
if (cuenta.cta_cte =' ') then
begin
gotoxy(12,3);writeln('Ud no posee una cuenta corriente');
readkey;
clrscr
end
else
begin
gotoxy(12,3);writeln ('el saldo es ',cuenta.bs_cte:2:2,'Bs');
writeln;
readkey;
clrscr
end;
if (cta<>'1')and(cta<>'2') then
begin
clrscr;
gotoxy(3,5);writeln('Opcion invalida. Intente de nuevo');
readkey;
clrscr
end
until (cta='1')or(cta='2');
'4': sw := false
else
begin
gotoxy(12,5);writeln ('opcion invalida');
end
end;
end;
clrscr;
end;
procedure Abrir_una_cuenta;
var
codigo : string[6];
r : char; //hay q agregar archivo para poder hacerlo con varios clientes
cta : char;
begin
clrscr;
cta:=' ';
cuenta.cta_aho:=' ';
cuenta.cta_cte:=' ';
writeln('*** Abrir_una_cuenta ***');
writeln;
gotoxy(5,4);writeln('Introduzca codigo de cliente');
gotoxy(5,5);readln(codigo);
clrscr;
if (codigo = cuenta.codigo1) then
repeat
gotoxy(3,3);writeln('1.para cuenta de ahorro');
gotoxy(3,4);writeln('2.para cuenta corriente');
gotoxy(3,6);cta:=readkey;
case cta of
'1':begin
clrscr;
if (cuenta.cta_aho=' ') then
begin
gotoxy(3,3);writeln('asigne numero de cuenta');
gotoxy(3,5);readln(cuenta.cta_aho);
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln('Usted ya posee una cuenta de este tipo');
readkey;
clrscr
end
end;
'2':begin
clrscr;
if (cuenta.cta_cte=' ') then
begin
gotoxy(3,3);writeln('asigne numero de cuenta');
gotoxy(3,5);readln(cuenta.cta_cte);
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln('Usted ya posee una cuenta de este tipo');
readkey;
clrscr
end;
end;
else
begin
clrscr;
gotoxy(12,4);writeln('opcion invalida, intente de nuevo')
end;
end;
gotoxy(12,5);writeln('desea abrir una nueva cuenta? [S/N]');
gotoxy(12,7);readln(r);
clrscr;
until (upcase(r)='N')
else
begin
gotoxy(12,3);writeln('cliente no encontrado');
readkey;
clrscr
end;
readln;
end;
procedure Cerrar_una_cuenta;
var
cta : string[20];
valor : real; {prueba}
begin
valor:=0.00;
clrscr;
writeln('*** Cerrar_una_cuenta ***');
gotoxy(3,3);writeln('cual es su numero de cuenta?');
gotoxy(3,4);readln(cta);
{aki va el for desd i hasta N, falta archivo}
if (cta = cuenta.cta_aho) then
if (cuenta.bs_aho > valor) then {prueba valor}
begin
clrscr;
gotoxy(3,3);writeln(' usted tiene un saldo de ',cuenta.bs_aho:2:2,'Bs espere su dinero');
cuenta.bs_aho:=0;
readkey;
clrscr;
gotoxy(3,3);writeln(' Su cuenta fue CERRADA exitosamente');
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln(' esta cuenta NO existe');readkey;clrscr
end
else
if (cuenta.bs_cte > valor) then {prueba valor}
begin
clrscr;
gotoxy(12,3);writeln('usted tiene un saldo de ',cuenta.bs_cte:2:3,'Bs espere su dinero');
cuenta.bs_cte:=0;
readkey;
clrscr;
gotoxy(12,3);writeln('Su cuenta fue CERRADA exitosamente');
readkey;
clrscr
end
else
begin
gotoxy(12,3);writeln('esta cuenta NO existe');readkey
end;
clrscr;
end;
procedure Consultar_estado_cuenta;
var
codigo : string[6];
cta : char;
begin
clrscr;
writeln('*** Consultar_estado_cuenta ***');
{for para buscar archivo por archivo}
{no estoy segura si este va aki, puede ser q vaya en el procedimiento de
abajo, pero, a mi parecer pidn lo mismo}
gotoxy(3,3);writeln('ingrese codigo cliente');
gotoxy(3,4);readln(codigo);
clrscr;
if (codigo = cuenta.codigo1) then
begin
gotoxy(3,3);writeln('1. INFORMACION CUENTA DE AHORRO');
gotoxy(3,4);writeln('2. INFORMACION CUENTA CORRIENTE');
gotoxy(3,5);cta:=readkey;
clrscr;
case cta of
'1' : if (cuenta.cta_aho = ' ')then
begin
gotoxy(3,3);writeln ('Ud no posee una cuenta de ahorro');
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln('Nombre : ',cuenta.nombre);
gotoxy(3,4);writeln('Apellido : ',cuenta.apellido1);
gotoxy(3,5);writeln('Saldo de su cuenta:',cuenta.bs_aho:2:2);
readkey;
clrscr
end;
'2' : if (cuenta.cta_cte = ' ')then
begin
writeln;
gotoxy(12,3);writeln ('Ud no posee una cuenta corriente');
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln('Nombre : ',cuenta.nombre);
gotoxy(3,4);writeln('Apellido : ',cuenta.apellido1);
gotoxy(3,5);writeln('Saldo de su cuenta:',cuenta.bs_cte:2:2);
readkey;
clrscr
end;
else
begin
gotoxy(12,3);writeln('Opcion Invalida');
readkey;
clrscr
end;
end;
end;
clrscr;
end;
{YA SUBO LA CONTINUACION}
uses
crt;
type
cliente = record
cedula : integer;
nombre : string[12];
apellido1 : string[12];
direccion : string[50];
telefono : string[12];
codigo1 : string[6];
cta_aho : string[20];
cta_cte : string[20];
bs_aho : real;
bs_cte : real
end;
var
cuenta : cliente;
procedure Registrar_nuevo_cliente;
var
codigo : string[6];
begin
gotoxy(12,2);write('*** Registrar_nuevo_cliente ***');
gotoxy(12,4);write('Entre Codigo Nuevo Cliente : ');
gotoxy(41,4);readln(codigo);
{aki va un for para recorrer todos los archivos}
if (codigo = cuenta.codigo1) then
begin
gotoxy(12,4);writeln('Este codigo ya se encuentra registrado ');
readkey;
clrscr
end
else
begin
clrscr;
cuenta.codigo1:=codigo;
gotoxy(12,2);write('*** Registrar_nuevo_cliente ***');
gotoxy(12,5);write('Cedula : ');
gotoxy(12,6);write('Nombre : ');
gotoxy(12,7);write('Apellido : ');
gotoxy(12,8);write('Direccion : ');
gotoxy(12,9);write('Telefono : ');
gotoxy(12,10);write('Codigo : ');
gotoxy(26,5);readln(cuenta.cedula);
gotoxy(26,6);readln(cuenta.nombre);
gotoxy(26,7);readln(cuenta.apellido1);
gotoxy(26,8);readln(cuenta.direccion);
gotoxy(26,9);readln(cuenta.telefono);
gotoxy(26,10);writeln(cuenta.codigo1);
writeln;
readkey;
clrscr;
end;
end;
procedure retiro_deposito_saldo;
var
valor,aux : real;
opc : char;
cta : char;
sw : boolean;
begin
sw:=true;
valor:=0.00;
while (sw = true) do
begin
clrscr;
gotoxy(3,2);writeln ('opc 1. depositar');
gotoxy(3,3);writeln ('opc 2. retirar');
gotoxy(3,4);writeln ('opc 3. consultar');
gotoxy(3,5);writeln ('opc 4. salir');
opc := readkey;
clrscr;
case opc of
'1':repeat
clrscr;
gotoxy(3,3);writeln('1.CUENTA DE AHORRO');
gotoxy(3,4);writeln('2.CUENTA CORRIENTE');
gotoxy(3,5);cta:=readkey;
clrscr;
if (cta = '1') then
if (cuenta.cta_aho =' ') then
begin
gotoxy(3,4);writeln('Ud no posee una cuenta de ahorro');
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln ('introduzca el monto');
gotoxy(3,5);read (aux);
clrscr;
if (aux > 0) THEN
cuenta.bs_aho:=cuenta.bs_aho + aux
else
gotoxy(3,4);writeln ('monto invalido');
clrscr;
end
else
if (cta = '2') then
if (cuenta.cta_cte =' ') then
begin
gotoxy(3,4);writeln('Ud no posee una cuenta corriente');
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln ('introduzca el monto');
gotoxy(3,4);read (aux);
clrscr;
if (aux > 0) THEN
cuenta.bs_cte:=cuenta.bs_cte + aux
else
begin
gotoxy(3,4);writeln ('monto invalido');
clrscr;
end
end;
if (cta<>'1')and(cta<>'2') then
begin
clrscr;
gotoxy(3,5);writeln('Opcion invalida. Intente de nuevo');
readkey;
clrscr
end
until (cta='1')or(cta='2');
'2':repeat
clrscr;
gotoxy(3,3);writeln('1.CUENTA DE AHORRO');
gotoxy(3,4);writeln('2.CUENTA CORRIENTE');
gotoxy(3,5);cta:=readkey;
clrscr;
if (cta = '1') then
if (cuenta.cta_aho =' ') then
begin
gotoxy(12,3);writeln('Ud no posee una cuenta de ahorro');
readkey;
clrscr
end
else
begin
gotoxy(12,3);writeln ('introduzca monto a retirar');
gotoxy(12,4);read (aux);
if (aux > cuenta.bs_aho) then
begin
gotoxy(12,5);writeln('No posee saldo suficiente para realizar esta transaccion');
readkey;
clrscr
end
else
if (cuenta.bs_aho=valor) then
begin
gotoxy(12,5);writeln('Saldo Insuficiente, Ud posee un saldo de: ', cuenta.bs_aho:2:2);
readkey;
clrscr
end
else
if (cuenta.bs_aho >= aux) then
cuenta.bs_aho := cuenta.bs_aho - aux
else
gotoxy(3,4);write ('monto invalido');
clrscr
end
else
if (cta = '2') then
if (cuenta.cta_cte =' ') then
begin
gotoxy(12,3);writeln('Ud no posee una cuenta corriente');
readkey;
clrscr
end
else
begin
gotoxy(12,3);writeln ('introduzca monto a retirar');
gotoxy(12,5);readln (aux);
if (cuenta.bs_cte=valor) then
begin
gotoxy(12,5);writeln('Saldo Insuficiente, Ud posee un saldo de: ', cuenta.bs_cte:2:2);
readkey;
clrscr
end
else
if (cuenta.bs_cte >= aux) then
cuenta.bs_cte := cuenta.bs_cte - aux
else
gotoxy(3,4);write ('monto invalido');
clrscr
end;
if (cta<>'1')and(cta<>'2') then
begin
clrscr;
gotoxy(3,5);writeln('Opcion invalida. Intente de nuevo');
readkey;
clrscr
end
until (cta='1')or(cta='2');
'3':repeat
clrscr;
gotoxy(3,3);writeln('1.CUENTA DE AHORRO');
gotoxy(3,4);writeln('2.CUENTA CORRIENTE');
gotoxy(3,5);cta:=readkey;
clrscr;
if (cta = '1') then
if (cuenta.cta_aho =' ') then
begin
gotoxy(12,3);writeln('Ud no posee una cuenta de ahorro');
readkey;
clrscr
end
else
begin
gotoxy(12,3);writeln ('el saldo es ',cuenta.bs_aho:2:2,'Bs');
writeln;
readkey;
clrscr
end
else
if (cta = '2') then
if (cuenta.cta_cte =' ') then
begin
gotoxy(12,3);writeln('Ud no posee una cuenta corriente');
readkey;
clrscr
end
else
begin
gotoxy(12,3);writeln ('el saldo es ',cuenta.bs_cte:2:2,'Bs');
writeln;
readkey;
clrscr
end;
if (cta<>'1')and(cta<>'2') then
begin
clrscr;
gotoxy(3,5);writeln('Opcion invalida. Intente de nuevo');
readkey;
clrscr
end
until (cta='1')or(cta='2');
'4': sw := false
else
begin
gotoxy(12,5);writeln ('opcion invalida');
end
end;
end;
clrscr;
end;
procedure Abrir_una_cuenta;
var
codigo : string[6];
r : char; //hay q agregar archivo para poder hacerlo con varios clientes
cta : char;
begin
clrscr;
cta:=' ';
cuenta.cta_aho:=' ';
cuenta.cta_cte:=' ';
writeln('*** Abrir_una_cuenta ***');
writeln;
gotoxy(5,4);writeln('Introduzca codigo de cliente');
gotoxy(5,5);readln(codigo);
clrscr;
if (codigo = cuenta.codigo1) then
repeat
gotoxy(3,3);writeln('1.para cuenta de ahorro');
gotoxy(3,4);writeln('2.para cuenta corriente');
gotoxy(3,6);cta:=readkey;
case cta of
'1':begin
clrscr;
if (cuenta.cta_aho=' ') then
begin
gotoxy(3,3);writeln('asigne numero de cuenta');
gotoxy(3,5);readln(cuenta.cta_aho);
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln('Usted ya posee una cuenta de este tipo');
readkey;
clrscr
end
end;
'2':begin
clrscr;
if (cuenta.cta_cte=' ') then
begin
gotoxy(3,3);writeln('asigne numero de cuenta');
gotoxy(3,5);readln(cuenta.cta_cte);
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln('Usted ya posee una cuenta de este tipo');
readkey;
clrscr
end;
end;
else
begin
clrscr;
gotoxy(12,4);writeln('opcion invalida, intente de nuevo')
end;
end;
gotoxy(12,5);writeln('desea abrir una nueva cuenta? [S/N]');
gotoxy(12,7);readln(r);
clrscr;
until (upcase(r)='N')
else
begin
gotoxy(12,3);writeln('cliente no encontrado');
readkey;
clrscr
end;
readln;
end;
procedure Cerrar_una_cuenta;
var
cta : string[20];
valor : real; {prueba}
begin
valor:=0.00;
clrscr;
writeln('*** Cerrar_una_cuenta ***');
gotoxy(3,3);writeln('cual es su numero de cuenta?');
gotoxy(3,4);readln(cta);
{aki va el for desd i hasta N, falta archivo}
if (cta = cuenta.cta_aho) then
if (cuenta.bs_aho > valor) then {prueba valor}
begin
clrscr;
gotoxy(3,3);writeln(' usted tiene un saldo de ',cuenta.bs_aho:2:2,'Bs espere su dinero');
cuenta.bs_aho:=0;
readkey;
clrscr;
gotoxy(3,3);writeln(' Su cuenta fue CERRADA exitosamente');
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln(' esta cuenta NO existe');readkey;clrscr
end
else
if (cuenta.bs_cte > valor) then {prueba valor}
begin
clrscr;
gotoxy(12,3);writeln('usted tiene un saldo de ',cuenta.bs_cte:2:3,'Bs espere su dinero');
cuenta.bs_cte:=0;
readkey;
clrscr;
gotoxy(12,3);writeln('Su cuenta fue CERRADA exitosamente');
readkey;
clrscr
end
else
begin
gotoxy(12,3);writeln('esta cuenta NO existe');readkey
end;
clrscr;
end;
procedure Consultar_estado_cuenta;
var
codigo : string[6];
cta : char;
begin
clrscr;
writeln('*** Consultar_estado_cuenta ***');
{for para buscar archivo por archivo}
{no estoy segura si este va aki, puede ser q vaya en el procedimiento de
abajo, pero, a mi parecer pidn lo mismo}
gotoxy(3,3);writeln('ingrese codigo cliente');
gotoxy(3,4);readln(codigo);
clrscr;
if (codigo = cuenta.codigo1) then
begin
gotoxy(3,3);writeln('1. INFORMACION CUENTA DE AHORRO');
gotoxy(3,4);writeln('2. INFORMACION CUENTA CORRIENTE');
gotoxy(3,5);cta:=readkey;
clrscr;
case cta of
'1' : if (cuenta.cta_aho = ' ')then
begin
gotoxy(3,3);writeln ('Ud no posee una cuenta de ahorro');
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln('Nombre : ',cuenta.nombre);
gotoxy(3,4);writeln('Apellido : ',cuenta.apellido1);
gotoxy(3,5);writeln('Saldo de su cuenta:',cuenta.bs_aho:2:2);
readkey;
clrscr
end;
'2' : if (cuenta.cta_cte = ' ')then
begin
writeln;
gotoxy(12,3);writeln ('Ud no posee una cuenta corriente');
readkey;
clrscr
end
else
begin
gotoxy(3,3);writeln('Nombre : ',cuenta.nombre);
gotoxy(3,4);writeln('Apellido : ',cuenta.apellido1);
gotoxy(3,5);writeln('Saldo de su cuenta:',cuenta.bs_cte:2:2);
readkey;
clrscr
end;
else
begin
gotoxy(12,3);writeln('Opcion Invalida');
readkey;
clrscr
end;
end;
end;
clrscr;
end;
{YA SUBO LA CONTINUACION}
Valora esta pregunta
0