voila plusieurs temps que j'essai de trouver les erreurs de compilation...
uses crt;
const
frais = 10;
fcinquante = 400;
var
nopo : string;
age : string;
sexe : string;
montant : string;
codeConducteur : string;
primeb : string;
rabais : string;
totaux : string;
primeNette : string;
fichier : text;
fich2 : text;
begin
clrscr;
assign (fichier, 'polices.dat');
reset (fichier);
assign (fich2, 'resultats.txt');
rewrite (fich2);
totalp := 0.00;
totalf := 0.00;
totalr := 0.00;
totalpn := 0.00;
while not (eof(fichier)) do
begin
readln (fichier,nopo,age,sexe,montant,codeConducteur);
if nopo < 1 000 then nopo := nopo * 1 000;
if (nopo % 2 = 0) and (age >= 18) and (age <= 39) and (montant <= 10 000) then
begin
primeb := (10 * montant) / 1 000;
end
else if (nopo % 2 = 0) and (age >= 18) and (age <= 39) and (montant > 10 000) and (montant <= 50 000) then
begin
primeb := (7.55 * montant / 1 000;
end
else if (nopo % 2 = 0) and (age >= 18) and (age <= 39) and (montant > 50 000) then
begin
primeb := fcinquante + (montant * 3 - 150 000) / 1 000;
end
else if (nopo % 2 = 0) and (age >= 40) and (age <= 54) and (montant <= 30 000) then
begin
primeb := (11 * montant) / 1 000;
end
else if (nopo % 2 = 0) and (age >= 40) and (age <= 54) and (montant > 30 000) then
begin
primeb := (8 * montant) / 1 000;
end
else if (nopo % 2 = 0) and (age >= 55) and (age <= 74) then
begin
primeb := (11 * montant) / 1 000;
end;
if (nopo % 2 = 0) and (age < 55) and sexe = F then
begin
rabais := (0.15 * primeb);
end;
if (nopo % 2 <> 0) and (age >= 18) and (age <= 25) and sexe = M then
begin
primeb := (100 * montant) / 1 000;
end;
else if (nopo % 2 <> 0) and (age >= 18) and (age <= 25) and sexe = F then
begin
primeb := (55 * montant) / 1 000;
end;
else if (nopo % 2 <> 0) and (age >= 26) and (age <= 65) and sexe = F or M then
begin
primeb := (40 * montant) / 1 000;
end;
else if (nopo % 2 <> 0) and (age >= 66) and (age <= 74) and sexe = M then
begin
primeb := (45 * montant) / 1 000;
end;
else if (nopo % 2 <> 0) and (age >= 66) and (age <= 74) and sexe = F then
begin
primeb := (90 * montant) / 1 000;
end;
if (nopo % 2 <> 0) and codeConducteur = 1 then rabais := (0.05 * primeb)
else
if (nopo % 2 <>0) and codeConducteur = 2 then rabais := 0
else
if (nopo % 2 <> 0) and codeConducteur = 3 then rabais := (0.20 * primeb)
else rabais := 0;
if (nopo % 2 <> 0) and codeConducteur = 3 then
primeNette := primeb + frais - rabais
else
primeNette := primeb + frais - rabais;
totalp := totalp + primeb;
totalf := totalf + frais;
totalr := totalr + rabais;
totalpn := totalpn + primeNette;
writeln('NO-POLICE = ' ,nopo);
writeln('AGE = ' ,age);
writeln('SEXE = ' ,sexe);
writeln('MONTANT = ' ,montant);
writeln('FRAIS = ' ,frais);
writeln('RABAIS = ' ,rabais);
writeln('PRIME-NETTE = ' ,primeNette);
writeln('-------------------------------------');
writeln('TOTAUX : ');
writeln(' = ' ,totalp);
writeln(' = ' ,totalf);
writeln(' = ' ,totalr);
writeln(' = ' ,totalpn);
writeln('--------------------------------------');
end;
close (fichier);
close (fich2);
end.
merci =)