Probleme avec les variables sur pascal

Fermé
HelliD2 Messages postés 1 Date d'inscription mardi 11 mai 2010 Statut Membre Dernière intervention 11 mai 2010 - 11 mai 2010 à 07:26
Salut tout le monde,

Je voudrais savoir si quelqun pourrait m'aider pour ce programme de pascal car les calculs avec les valeurs ne s'effectuent pas correctement.

Merci d'avance! :D

program BSUprogram;

uses wincrt;

var
salary2,salary3:real;
salary,salary1,age:integer;
choice,choice1:char;
begin
write('Enter you salary:');
read(salary);
write('Enter your age:');
read(age);
salary1:=0;
salary1 := salary;
writeln('');
writeln('Choose a Health insurance option');
writeln('A: 95.25 per month');
writeln('B: 53.75 per month');
writeln('C: 27.50 per month');

readln(choice);
begin
if choice='A' then

salary2:=salary1-95.25;

if choice='B' then

salary2:=salary1-53.75;

if choice='C' then

salary2:=salary1-27.50;
end;
salary3 := salary2;
writeln('Choose a disability insurance option');
writeln('X: Paid by BSU no charge for the employee');
write('Y: 5.25$ per month if the employee salary is less than 2000$/month ');
writeln('and costs 7.50 if the salary is more than 2000$/month');
readln(choice1);
begin
if choice1='X' then
salary3 := salary2-0;

if choice1='Y' then




if salary1<2000 then
salary3:=salary2-5.25;

if salary1>2000 then
salary3:=salary2-7.5;

end;

writeln('Your salary is:',salary3:2:2);

end.