You are on page 1of 3

INSFP de Mostaganem TS IBD COURS DU SOIR DELPHI Mr BENSTAALI

CORRECTION DE L’EXERCICE DE CALCUL DES MONTANTS D’UNE

FACTURE

BOUTON CALCULER

var
PU1,PU2,PU3,QT1,QT2,QT3,TVA,MHT1,MHT2,MHT3,MTHT,MTTC:Real;

begin

MHT1:=0;
INSFP de Mostaganem TS IBD COURS DU SOIR DELPHI Mr BENSTAALI

MHT2:=0;

MHT3:=0;

if (edit3.Text<>'') and (edit4.Text<>'') then

begin

PU1:=strtofloat(edit3.Text);

QT1:=strtofloat(edit4.Text);

MHT1:=PU1*QT1;

edit5.Text:=floattostr(MHT1);

end;

if (edit8.Text<>'') and (edit9.Text<>'') then

begin

PU2:=strtofloat(edit8.Text);

QT2:=strtofloat(edit9.Text);

MHT2:=PU2*QT2;

edit10.Text:=floattostr(MHT2);

end;

if (edit13.Text<>'') and (edit14.Text<>'') then

begin

PU3:=strtofloat(edit13.Text);

QT3:=strtofloat(edit14.Text);
INSFP de Mostaganem TS IBD COURS DU SOIR DELPHI Mr BENSTAALI

MHT3:=PU3*QT3;

edit15.Text:=floattostr(MHT3);

end;

MTHT:=MHT1+MHT2+MHT3;

edit16.Text:=floattostr(MTHT);

if radiogroup1.ItemIndex = 0 then TVA:= 7;

if radiogroup1.ItemIndex = 1 then TVA:= 14;

if radiogroup1.ItemIndex = 2 then TVA:= 21;

MTTC:=MTHT*(1+TVA/100);

edit17.Text:=floattostr(MTTC);

end;

You might also like