• Viernes 29 de Marzo de 2024, 08:19

Autor Tema:  calcula una operacion de bolsa  (Leído 1583 veces)

keko

  • Nuevo Miembro
  • *
  • Mensajes: 9
    • Ver Perfil
calcula una operacion de bolsa
« en: Lunes 13 de Enero de 2003, 13:03 »
0
ya se que es una ful pero bueno x si te da por comprar o vender acciones x cajamadrid

program calc;
uses wincrt;
var
te:char;
a,b,c:real;
kan,can,pre,d,dd,ca,ga,toc,tac:real;
begin
repeat
kan:=0;can:=0;pre:=0;d:=0;dd:=0;ca:=0;ga:=0;toc:=0;taC:=0;
te:=' ';
clrscr;
write('cantidad en euros ');read(can);
write('precio ');read(pre);
kan:=can/pre;
writeln('con ',can:0:2,' a ',pre:0:2,' puedes comprar ',kan:0:2);

write('cuantas? ');
read(a);
write('precio? ');
read(b);
clrscr;

{canon}
c:=a*b;
if c<=30 then ca:=0.04;
if (c>30.01) and (c<=300) then ca:=1.20;
if (c>=300.01) and (c<=1500) then ca:=2.53;
if (c>=1500.01) and (c<=3000) then ca:=3.97;
if (c>=3000.01) and (c<=6000) then ca:=5.40;
if (c>=6000.01) and (c<=15000) then ca:=7.02;
if (c>=15000.01) and (c<=30000) then ca:=8.42;
if (c>=30000.01) and (c<=45000) then ca:=9.91;
if (c>=45000.01) and (c<=150000) then ca:=11.35;
if (c>=150000.01) and (c<=300000) then ca:=12.85;
if c>=300000.01 then ca:=14.20;
{lo q se lleva el banco minimo 3.00}
d:=c*0.35/100;
if d<3 then d:=3;
{y el corretaje minimo 4.50}
dd:=c*0.25/100;
if dd<4.50 then dd:=4.50;

writeln('compra----------------');
writeln('acciones: ',a:0:2);
writeln('precio: ',b:0:2);
writeln('banco: ',d:0:2);
writeln('bolsa: ',dd:0:2);
writeln('canon: ',ca:0:2);
ga:=d+dd+ca;
writeln('gastos: ',ga:0:2);
toc:=c+ga;
writeln('TOTAL: ',toc:0:2);
writeln('---------------------');
write('precio venta? ');
read(b);
c:=a*b;
if c<=30 then ca:=0.04;
if (c>30.01) and (c<=300) then ca:=1.20;
if (c>=300.01) and (c<=1500) then ca:=2.53;
if (c>=1500.01) and (c<=3000) then ca:=3.97;
if (c>=3000.01) and (c<=6000) then ca:=5.40;
if (c>=6000.01) and (c<=15000) then ca:=7.02;
if (c>=15000.01) and (c<=30000) then ca:=8.42;
if (c>=30000.01) and (c<=45000) then ca:=9.91;
if (c>=45000.01) and (c<=150000) then ca:=11.35;
if (c>=150000.01) and (c<=300000) then ca:=12.85;
if c>=300000.01 then ca:=14.20;

d:=c*0.35/100;
if d<3 then d:=3;
dd:=c*0.25/100;
if dd<4.50 then dd:=4.50;

writeln('venta----------------');
writeln('acciones: ',a:0:2);
writeln('precio: ',b:0:2);
writeln('banco: ',d:0:2);
writeln('bolsa: ',dd:0:2);
writeln('canon: ',ca:0:2);
ga:=d+dd+ca;
writeln('gastos: ',ga:0:2);
tac:=c-ga;
writeln('TOTAL: ',tac:0:2);
writeln('--------------------------');
writeln('resultado venta-compra ',tac-toc:0:2);
ga:=(tac-toc)*166.386;
writeln('lo mismo pero en pesetas ',ga:0:2);
writeln('pulsa (s) salir o (n) para continuar ');
repeat
if keypressed then te:=readkeY;
until (te='s') or (te='n');
until te='s';

end.
El mensaje contiene 1 archivo adjunto. Debes ingresar o registrarte para poder verlo y descargarlo.