Sie sind auf Seite 1von 2

procedure TForm1.Button1Click(Sender: TObject); var a,b,c,d,e:real; var bonus:string; begin a:=strtofloat(edit1.Text ); b:=strtofloat(edit2.

Text ); c:=a*b; // mencari diskon dengan prosedure proccaridiskon(c,d); edit3.Text :=floattostr(c); edit4.Text :=floattostr(d); e:=c-d; edit5.Text :=floattostr(e); //Mencari Bonus dengan Fungsi edit6.Text :=functcaribonus(e); procedure proccaridiskon(var x:real;var y:real); begin if x>=1000000 then y:=0.1*x else if x>=500000 then y:=0.05*x else y:=0;

end; Function functcaribonus(var total:real):string; begin if total>=1000000 then functcaribonus:='Payung Cantik' else if total>=500000 then functcaribonus:='Sendal Cantik' else functcaribonus:='Tidak dapat'; end;

Das könnte Ihnen auch gefallen