Pascal/Turbo Pascal - Ayuda!! en pascall xfavorrr!

 
Vista:

Ayuda!! en pascall xfavorrr!

Publicado por ammm! (4 intervenciones) el 06/08/2011 22:23:17
Hola tengo que hacer un programa en pascal, que consiste en la construccion de un programa que emule el sistema de elecciones y votaciones nacionales, dond los cuidadanos ingresan y dan su numero de cedula e inmediatamente el programa mostrará el nombre completo del cuidadano, la edad, lugar de residencia y distrito de votacion..

No tengo idea como hacer si me pueden ayudar se los agradeceria, xfavor
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Ayuda!! en pascall xfavorrr!

Publicado por ramon (2158 intervenciones) el 07/08/2011 22:52:42
{A ver si esto te empieza a ayudar}

program eleccion;
uses
crt, dos;
type
nombres = record
nombre : string[30];
apell1 : string[30];
apell2 : string[30];
DNI : string[40];
calle : string[50];
ciudad : string[40];
provin : string[40];
nacio : string[10];
codipos : word;
distrito : longint;
end;


var
f : file of nombres;
datos : nombres;
tecla : char;
x, y, i, cont : integer;
salvar : boolean;
yy,mm,dd,dww : word;


procedure pantalla_datos(d : char);
begin
clrscr;
gotoxy(3,4);write('Nombre : ');
gotoxy(3,6);write('1ø Apellido : ');
gotoxy(3,8);write('2ø Apellido : ');
gotoxy(3,10);write('N§ DNI : ');
gotoxy(3,12);write('Calle : ');
gotoxy(3,14);write('Ciudad : ');
gotoxy(3,16);write('Provincia : ');
gotoxy(3,18);write('Codi.Post. : ');
gotoxy(3,20);write('Distrito : ');
if d = 'e' then
begin
gotoxy(3,22);write('Nacio El : Ejen : 01/02/2011');
end
else
begin
gotoxy(3,22);write('Edad Actual : ')
end;
end;

procedure entrada_datos;
var
anul : boolean;
dat, tec : char;
ent : integer;
entra : string[50];
coposta : word;
error : integer;
begin
x := 16;
y := 4;
gotoxy(x,y);
i := 1;
anul := false;
ent := 1;
dat := 't';
repeat
tec := readkey;
if tec <> #27 then
begin
if dat = 't' then
begin
if tec in[#32,#38..#126,#154,#165] then
begin
entra[ent] := tec;
entra[0] := chr(ent);
gotoxy(x + ent,y);write(entra[ent]);
ent := ent + 1;
if ent > 50 then
ent := 50;
end;
end;
if dat = 'n' then
begin
if tec in[#48..#57] then
begin
entra[ent] := tec;
entra[0] := chr(ent);
gotoxy(x + ent,y);write(entra[ent]);
ent := ent + 1;
if ent > 50 then
ent := 50;
end;
end;
if tec = #8 then
begin
ent := ent - 1;
if ent < 1 then
ent := 1;
entra[ent] := ' ';
entra[0] := chr(ent);
gotoxy(x + ent,y);write(entra[ent]);
end;
if tec = #13 then
begin
case i of
1 : begin
datos.nombre := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
2 : begin
datos.apell1 := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
3 : begin
datos.apell2 := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
4 : begin
datos.DNI := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
5 : begin
datos.calle := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
6 : begin
datos.ciudad := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
7 : begin
datos.provin := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 'n';
gotoxy(x,y);
end;
8 : begin
val(entra,coposta,error);
datos.codipos := coposta;
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 'n';
gotoxy(x,y);
end;
9 : begin
val(entra,coposta,error);
datos.distrito := coposta;
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
10 : begin
datos.nacio := copy(entra,1,length(entra));
gotoxy(x,y);
end;
end;
i := i + 1;
end;
end
else
begin
anul := true;
end;
until (i > 10) or (anul = true);
if (i > 10) and (anul = false) then
begin
salvar := true;
end
else
begin
salvar := false;
end;
end;

procedure busca_datos;
var
tc : char;
ndni : string[40];
err, zi : integer;
arh : longint;
sal : boolean;
dav : string[4];
fech : word;
begin
gotoxy(3,3);write('N§ DNI : ');
gotoxy(11,3);
zi := 1;
sal := false;
repeat
tc := readkey;
if tc in[#32,#38..#126,#154,#165] then
begin
ndni[zi] := tc;
ndni[0] := chr(zi);
gotoxy(10 + zi,3);write(ndni[zi]);
zi := zi + 1;
if zi > 40 then
zi := 40;
end;
if tc = #8 then
begin
zi := zi - 1;
if zi < 1 then
zi := 1;
ndni[zi] := ' ';
ndni[0] := chr(zi);
gotoxy(10 + zi,3);write(ndni[zi]);
end;
until (tc = #13) or (tc = #27);
if (tc = #13) and (zi > 2) then
begin
assign(f,'c:\VaseDato.bsd');
{$I-} reset(f); {$I+}
if ioresult <> 0 then
begin
clrscr;
writeln('Falta El Archivo VaseDato.bsd');
writeln;
writeln('Pulse Enter');
repeat
tc := readkey;
until tc = #13;
end
else
begin
arh := 0;
repeat
seek(f,arh);
read(f,datos);
if datos.dni = ndni then
begin
sal := true;
end;
arh := arh + 1;
until (sal = true) or (arh > filesize(f) - 1);
if sal = true then
begin
y := 4;
clrscr;
pantalla_datos('d');
gotoxy(16,y);write(datos.nombre);
y := y + 2;
gotoxy(16,y);write(datos.apell1);
y := y + 2;
gotoxy(16,y);write(datos.apell2);
y := y + 2;
gotoxy(16,y);write(datos.dni);
y := y + 2;
gotoxy(16,y);write(datos.calle);
y := y + 2;
gotoxy(16,y);write(datos.ciudad);
y := y + 2;
gotoxy(16,y);write(datos.provin);
y := y + 2;
gotoxy(16,y);write(datos.codipos);
y := y + 2;
gotoxy(16,y);write(datos.distrito);
y := y + 2;
GetDate(yy,mm,dd,dww);
dav := copy(datos.nacio,(length(datos.nacio) - 3),length(datos.nacio) + 1);
val(dav,fech,err);
gotoxy(16,y);write((yy - fech));
gotoxy(3,y + 3);write('PULSE ENTER');
repeat
tc := readkey;
until tc = #13;
end
else
begin
clrscr;
writeln;
writeln('El DNI No Esta En La Vase ');
writeln('--- [Pulse Enter] ---');
repeat
tc := readkey;
until tc = #13;
end;
end;
end;
end;

procedure panta_menu;
begin
gotoxy(1,1);write('*** MENU GENERAL ***');
gotoxy(4,3);write(' 1 Entrada Datos');
gotoxy(4,5);write(' 2 Comparar Datos');
gotoxy(4,7);write(' 3 Salir');
gotoxy(4,9);write('<< Elija Opcion >>');
end;


procedure menu;
var
erro, opcion : integer;
salir : boolean;
pul : char;
begin
panta_menu;
opcion := 1;
salir := false;
repeat
pul := readkey;
if pul in[#49..#51] then
begin
val(pul,opcion,erro);
case opcion of
1 : begin
pantalla_datos(' ');
entrada_datos;
if salvar = true then
begin
assign(f,'c:\VaseDato.bsd');
{$I-} reset(f); {$I+}
if ioresult <> 0 then
begin
rewrite(f);
seek(f,0);
write(f,datos);
close(f);
end
else
begin
seek(f,filesize(f));
write(f,datos);
close(f);
end;
end;
clrscr;
panta_menu;
end;
2 : begin
clrscr;
busca_datos;
clrscr;
panta_menu;
end;
3 : begin
clrscr;
salir := true;
end;
end;
end;
until (salir = true) or (pul = #27);
end;


begin
clrscr;
textcolor(15);
menu;
end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Ayuda!! en pascall xfavorrr!

Publicado por ammm! (4 intervenciones) el 08/08/2011 03:33:13
Muchas gracias amigooo! esta buenisimo te lo agradezco,

ahora solo me falta ingeniarmela y le meterle a eso, una papelera de 3 candidatos, y ahi mismo el cuidadano escoja el preferido.... y este programa me imprima el conteo de votos que obtuvo cada candidato por distritos!!

La verdad soy un nobato que hace sus primeeras armas en programaacionn :(( !!
muchas gracias buen dia!! PD: si me dan otra ideita de como hacerle este me avisan gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Ayuda!! en pascall xfavorrr!

Publicado por ramon (2158 intervenciones) el 09/08/2011 17:42:17
{te envié el mismo por equivocación mira a ver esto si te ayuda mas lo mando en dos paquetes}

program eleccion;
uses
crt, dos;
type
nombres = record
nombre : string[30];
apell1 : string[30];
apell2 : string[30];
DNI : string[40];
calle : string[50];
ciudad : string[40];
provin : string[40];
nacio : string[10];
codipos : word;
distrito : longint;
end;

candidatos = record
nomb : string[30];
apell1 : string[30];
apell2 : string[30];
DNIC : string[40];
botos : integer;
end;

bota = record
dni : string[40];
bot : boolean;
end;

var
fcan : file of candidatos;
cand : array[1..3] of candidatos;
f : file of nombres;
datos : nombres;
tecla : char;
num, x, y, i, cont : integer;
salvar : boolean;
yy,mm,dd,dww : word;
botan : array[1..50] of bota;

procedure pantalla_datos(d : char);
begin
clrscr;
if d = 'e' then
begin
gotoxy(3,1);write('*** Entrada De Datos *** [ESC] AVANDONAR');
end
else
begin
gotoxy(3,1);write('<<< Informacion >>> [ESC] AVANDONAR');
end;
gotoxy(3,4);write('Nombre : ');
gotoxy(3,6);write('1ø Apellido : ');
gotoxy(3,8);write('2ø Apellido : ');
gotoxy(3,10);write('N§ DNI : ');
gotoxy(3,12);write('Calle : ');
gotoxy(3,14);write('Ciudad : ');
gotoxy(3,16);write('Provincia : ');
gotoxy(3,18);write('Codi.Post. : ');
gotoxy(3,20);write('Distrito : ');
if d = 'e' then
begin
gotoxy(3,22);write('Nacio El : Ejen : 01/02/2011');
end
else
begin
gotoxy(3,22);write('Edad Actual : ')
end;
end;

procedure entrada_datos;
var
anul : boolean;
dat, tec : char;
ent : integer;
entra : string[50];
coposta : word;
error : integer;
begin
x := 16;
y := 4;
gotoxy(x,y);
i := 1;
anul := false;
ent := 1;
dat := 't';
repeat
tec := readkey;
if tec <> #27 then
begin
if dat = 't' then
begin
if tec in[#32,#38..#126,#154,#165] then
begin
entra[ent] := tec;
entra[0] := chr(ent);
gotoxy(x + ent,y);write(entra[ent]);
ent := ent + 1;
if ent > 50 then
ent := 50;
end;
end;
if dat = 'n' then
begin
if tec in[#48..#57] then
begin
entra[ent] := tec;
entra[0] := chr(ent);
gotoxy(x + ent,y);write(entra[ent]);
ent := ent + 1;
if ent > 50 then
ent := 50;
end;
end;
if tec = #8 then
begin
ent := ent - 1;
if ent < 1 then
ent := 1;
entra[ent] := ' ';
entra[0] := chr(ent);
gotoxy(x + ent,y);write(entra[ent]);
end;
if tec = #13 then
begin
case i of
1 : begin
datos.nombre := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
2 : begin
datos.apell1 := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
3 : begin
datos.apell2 := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
4 : begin
datos.DNI := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
5 : begin
datos.calle := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
6 : begin
datos.ciudad := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
7 : begin
datos.provin := copy(entra,1,length(entra));
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 'n';
gotoxy(x,y);
end;
8 : begin
val(entra,coposta,error);
datos.codipos := coposta;
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 'n';
gotoxy(x,y);
end;
9 : begin
val(entra,coposta,error);
datos.distrito := coposta;
y := y + 2;
ent := 1;
fillchar(entra,51,' ');
entra[0] := chr(50);
dat := 't';
gotoxy(x,y);
end;
10 : begin
datos.nacio := copy(entra,1,length(entra));
gotoxy(x,y);
end;
end;
i := i + 1;
end;
end
else
begin
anul := true;
end;
until (i > 10) or (anul = true);
if (i > 10) and (anul = false) then
begin
salvar := true;
end
else
begin
salvar := false;
end;
end;

procedure busca_datos;
var
tc : char;
ndni : string[40];
err, zi : integer;
arh : longint;
sal : boolean;
dav : string[4];
fech : word;
begin
gotoxy(3,3);write('N§ DNI : [ESC] AVANDONA');
gotoxy(11,3);
zi := 1;
sal := false;
repeat
tc := readkey;
if tc in[#32,#38..#126,#154,#165] then
begin
ndni[zi] := tc;
ndni[0] := chr(zi);
gotoxy(10 + zi,3);write(ndni[zi]);
zi := zi + 1;
if zi > 40 then
zi := 40;
end;
if tc = #8 then
begin
zi := zi - 1;
if zi < 1 then
zi := 1;
ndni[zi] := ' ';
ndni[0] := chr(zi);
gotoxy(10 + zi,3);write(ndni[zi]);
end;
until (tc = #13) or (tc = #27);
if (tc = #13) and (zi > 2) then
begin
assign(f,'c:\VaseDato.bsd');
{$I-} reset(f); {$I+}
if ioresult <> 0 then
begin
clrscr;
writeln('Falta El Archivo VaseDato.bsd');
writeln;
writeln('Pulse Enter');
repeat
tc := readkey;
until tc = #13;
end
else
begin
arh := 0;
repeat
seek(f,arh);
read(f,datos);
if datos.dni = ndni then
begin
sal := true;
end;
arh := arh + 1;
until (sal = true) or (arh > filesize(f) - 1);
if sal = true then
begin
y := 4;
clrscr;
pantalla_datos(' ');
gotoxy(16,y);write(datos.nombre);
y := y + 2;
gotoxy(16,y);write(datos.apell1);
y := y + 2;
gotoxy(16,y);write(datos.apell2);
y := y + 2;
gotoxy(16,y);write(datos.dni);
y := y + 2;
gotoxy(16,y);write(datos.calle);
y := y + 2;
gotoxy(16,y);write(datos.ciudad);
y := y + 2;
gotoxy(16,y);write(datos.provin);
y := y + 2;
gotoxy(16,y);write(datos.codipos);
y := y + 2;
gotoxy(16,y);write(datos.distrito);
y := y + 2;
GetDate(yy,mm,dd,dww);
dav := copy(datos.nacio,(length(datos.nacio) - 3),length(datos.nacio) + 1);
val(dav,fech,err);
gotoxy(16,y);write((yy - fech));
gotoxy(3,y + 3);write('PULSE ENTER');
repeat
tc := readkey;
until tc = #13;
end
else
begin
clrscr;
writeln;
writeln('El DNI No Esta En La Vase ');
writeln('--- [Pulse Enter] ---');
repeat
tc := readkey;
until tc = #13;
end;
end;
end;
end;

procedure panta_menu;
begin
gotoxy(1,1);write('*** MENU GENERAL ***');
gotoxy(4,3);write(' 1 Entrada Datos');
gotoxy(4,5);write(' 2 Comparar Datos');
gotoxy(4,7);write(' 3 Entrada Candidatos');
gotoxy(4,9);write(' 4 Elecion Candidato');
gotoxy(4,11);write(' 5 Salir');
gotoxy(4,13);write('<< Elija Opcion >>');
end;

procedure entra_candidatos;
var
datocon : string[40];
tdc : char;
candi, com, ni : integer;
borra, posx, posy : integer;
fin : boolean;
begin
clrscr;
gotoxy(3,1);write(' *** Candidatos ***');
gotoxy(3,3);write('Nombre : ');
gotoxy(3,5);write('1§ Apellido : ');
gotoxy(3,7);write('2§ Apellido : ');
gotoxy(3,9);write('N§ DNI : ');
gotoxy(3,11);write('Entre Datos [ESC] Avandobar');
posx := 16;
posy := 3;
gotoxy(posx,posy);
ni := 1;
com := 1;
fin := false;
fillchar(datocon,41,' ');
datocon[0] := chr(40);
candi := 1;
repeat
gotoxy(posx,posy);
repeat
tdc := readkey;
if tdc in[#32,#38..#126,#154,#165] then
begin
datocon[ni] := tdc;
datocon[0] := chr(ni);
gotoxy(posx + ni,posy);write(datocon[ni]);
ni := ni + 1;
if ni > 40 then
ni := 40;
end;
if tdc = #8 then
begin
ni := ni - 1;
if ni < 1 then
ni := 1;
datocon[ni] := ' ';
datocon[0] := chr(ni);
gotoxy(posx + ni,posy);write(datocon[ni]);
end;
if tdc = #13 then
begin
case com of
1 : begin
cand[candi].nomb := copy(datocon,1,length(datocon));
posy := posy + 2;
fillchar(datocon,41,' ');
datocon[0] := chr(40);
ni := 1;
com := com + 1;
gotoxy(posx,posy);
end;
2 : begin
cand[candi].apell1 := copy(datocon,1,length(datocon));
posy := posy + 2;
fillchar(datocon,41,' ');
datocon[0] := chr(40);
ni := 1;
com := com + 1;
gotoxy(posx,posy);
end;
3 : begin
cand[candi].apell2 := copy(datocon,1,length(datocon));
posy := posy + 2;
fillchar(datocon,41,' ');
datocon[0] := chr(40);
ni := 1;
com := com + 1;
gotoxy(posx,posy);
end;
4 : begin
cand[candi].DNIC := copy(datocon,1,length(datocon));
fin := true;
com := com + 1;
fin := true;
end;
end;
end;
until (com > 4) or (tdc = #27);
if (com > 4) and (fin = true) then
begin
assign(fcan,'c:\Candidat.cdt');
{$I-} reset(fcan); {$I+}
if ioresult <> 0 then
begin
rewrite(fcan);
seek(fcan,0);
write(fcan,cand[candi]);
close(fcan);
end
else
begin
seek(fcan,filesize(fcan));
write(fcan,cand[candi]);
close(fcan);
end;
end;
borra := 1;
repeat
gotoxy(16,borra);clreol;
borra := borra + 2;
until borra > 9;
candi := candi + 1;
fin := false;
until (candi > 3) or (tdc = #27);
end;
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Ayuda!! en pascall xfavorrr!

Publicado por ramon (2158 intervenciones) el 09/08/2011 17:43:50
{paquete 2}

function botante : boolean;
var
tg : char;
dninume : string[40];
ii, xn, yn, coh : integer;
arh : longint;
esta, sale : boolean;
begin
botante := false;
gotoxy(3,19);write('BOTANTE CON DNI');
gotoxy(3,20);write('Entre N§ DNI : ');
gotoxy(17,20);
coh := 1;
fillchar(dninume,41,' ');
dninume[0] := chr(40);
yn := 20;
xn := 17;
repeat
tg := readkey;
if tg in[#32,#38..#126,#154,#165] then
begin
dninume[coh] := tg;
dninume[0] := chr(coh);
gotoxy(xn + coh,yn);write(dninume[coh]);
coh := coh + 1;
if coh > 40 then
coh := 40;
end;
if tg = #8 then
begin
coh := coh - 1;
if coh < 1 then
coh := 1;
dninume[coh] := ' ';
dninume[0] := chr(coh);
gotoxy(xn + coh,yn);write(dninume[coh]);
end;
until (tg = #13) or (tg = #27);
if tg = #13 then
begin
assign(f,'c:\VaseDato.bsd');
{$I-} reset(f); {$I+}
if ioresult <> 0 then
begin
clrscr;
writeln('Falta El Archivo VaseDato.bsd');
writeln;
writeln('Pulse Enter');
repeat
tg := readkey;
until tg = #13;
end
else
begin
arh := 0;
esta := false;
repeat
seek(f,arh);
read(f,datos);
if datos.dni = dninume then
begin
sale := true;
end;
arh := arh + 1;
until (sale = true) or (arh > filesize(f) - 1);
if sale = true then
begin
ii := 1;
repeat
if botan[ii].dni = dninume then
esta := true;
ii := ii + 1;
until (ii > num - 1) or (esta = true);
if esta = true then
begin
sale := false;
gotoxy(3,22);write('USTED YA BOTO ANTES NO AZMITIDO');
gotoxy(3,23);write('*** Pulse Barra Espaciadora ***');
repeat
tg := readkey;
until tg = #32;
botante := false;
gotoxy(3,22);clreol;
gotoxy(3,23);clreol;
end
else
begin
botante := true;
botan[num].dni := copy(dninume,1,length(dninume));
botan[num].bot := true;
num := num + 1;
if num > 50 then
num := 50;
gotoxy(3,19);clreol;
gotoxy(3,20);clreol;
end;
end;
end;
end;
end;

procedure presentacion_candidatos;
var
can : char;
candigana, cn : integer;
botos1, botos2, botos3 : longint;
long : longint;
noprese : boolean;
begin
assign(fcan,'c:\Candidat.cdt');
{$I-} reset(fcan); {$I+}
if ioresult <> 0 then
begin
writeln('<<<<< ARCHIVO Candidat.cdt No EXISTE >>>>>');
writeln;
writeln(' [PULSE ENTER] ');
repeat
can := readkey;
until can = #13;
end
else
begin
cn := 0;
botos1 := 0;
botos2 := 0;
botos3 := 0;
repeat
seek(fcan,cn);
read(fcan,cand[cn + 1]);
cn := cn + 1;
until cn > filesize(fcan) - 1;
close(fcan);
gotoxy(6,1);write('*** ELIJA N§ CANDIDATO ***');
gotoxy(3,3);write('[1] Para : ',cand[1].nomb,' ',cand[1].apell1,' ',cand[1].apell2,' : ');
gotoxy(3,5);write('[2] Para : ',cand[2].nomb,' ',cand[1].apell1,' ',cand[1].apell2,' : ');
gotoxy(3,7);write('[3] Para : ',cand[3].nomb,' ',cand[1].apell1,' ',cand[1].apell2,' : ');
gotoxy(6,10);write('CANDIDATO N§ : Finalizar [Enter]');
gotoxy(21,10);
noprese := true;
repeat
if botante = true then
begin
gotoxy(3,20);clreol;
gotoxy(21,10);
can := readkey;
if can in[#49..#51] then
begin
case can of
#49 : begin
botos1 := botos1 + 1;
long := (length(cand[1].nomb) + length(cand[1].apell1) +
length(cand[1].apell2) + 19);
gotoxy(long,3);write(botos1);
end;
#50 : begin
botos2 := botos2 + 1;
long := (length(cand[2].nomb) + length(cand[2].apell1) +
length(cand[2].apell2) + 18);
gotoxy(long,5);write(botos2);
end;
#51 : begin
botos3 := botos3 + 1;
long := (length(cand[3].nomb) + length(cand[3].apell1) +
length(cand[3].apell2) + 16);
gotoxy(long,7);write(botos3);
end;
end;
end;
end
else
begin
repeat
gotoxy(3,22);write(' *** Usted No Esta En La Vase De Datos ***');
gotoxy(3,23);write(' <<< Pulse [ESC] >>> ');
can := readkey;
noprese := false;
until (can = #27) or (can = #13);
gotoxy(3,20);clreol;
gotoxy(3,22);clreol;
gotoxy(3,23);clreol;
end;
until can = #13;
if (can = #13) and (noprese = true) then
begin
cand[1].botos := botos1;
cand[2].botos := botos2;
cand[3].botos := botos3;
if botos1 > botos2 then
begin
if botos1 > botos3 then
candigana := 1
else
candigana := 3;
end
else
begin
if botos1 > botos3 then
candigana := 2
else
candigana := 3;
end;
clrscr;
gotoxy(3,2);write('*** Candidato Ganador Es ***');
gotoxy(3,5);write(cand[candigana].nomb,' ',cand[candigana].apell1,
' ',cand[candigana].apell1);
case candigana of
1 : begin gotoxy(3,7);write('N§ Botos = ',botos1); end;
2 : begin gotoxy(3,7);write('N§ Botos = ',botos2); end;
3 : begin gotoxy(3,7);write('N§ Botos = ',botos3); end;
end;
end;
end;
end;

procedure botaciones;
begin
clrscr;
presentacion_candidatos;
end;

procedure menu;
var
erro, opcion : integer;
salir : boolean;
pul : char;
begin
panta_menu;
opcion := 1;
salir := false;
repeat
pul := readkey;
if pul in[#49..#53] then
begin
val(pul,opcion,erro);
case opcion of
1 : begin
pantalla_datos('e');
entrada_datos;
if salvar = true then
begin
assign(f,'c:\VaseDato.bsd');
{$I-} reset(f); {$I+}
if ioresult <> 0 then
begin
rewrite(f);
seek(f,0);
write(f,datos);
close(f);
end
else
begin
seek(f,filesize(f));
write(f,datos);
close(f);
end;
end;
clrscr;
panta_menu;
end;
2 : begin
clrscr;
busca_datos;
clrscr;
panta_menu;
end;
3 : begin
clrscr;
entra_candidatos;
clrscr;
panta_menu;
end;
4 : begin
clrscr;
botaciones;
clrscr;
panta_menu;
end;
5 : begin
clrscr;
salir := true;
end;
end;
end;
until (salir = true) or (pul = #27);
end;




begin
clrscr;
textcolor(15);
num := 1;
menu;
end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Ayuda!! en pascall xfavorrr!

Publicado por ammm! (4 intervenciones) el 10/08/2011 03:57:33
y SI QUIERo meterle un nombre inventado, k me lo almacene, en el registro!!
ejemplo: daniel
edad 10
DNI: 125 544
provincia sanjose

donde lo meto???
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Ayuda!! en pascall xfavorrr!

Publicado por ramon (2158 intervenciones) el 10/08/2011 17:58:30
La entrada datos es la entrada de votantes de ese distrito se imagina y la entrada candidatos para los que se presenten como tal en este caso 3 en el entra nombre y apellidos y dni,
y en votantes tienes nombre, apell1, apell2,DNI, calle, ciudad, provin, nacio, codipos, distrito,
como puedes apreciar la edad sera la fecha de nacimiento y el ordenador te dira la edad a fecha
de votaciones;
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar