unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
Label4: TLabel;
Button2: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var x,y,z:real;
begin
readln(x);readln(y);
x:=strtofloat(edit1.text);
y:=strtofloat(edit2.text) ;
if x<0 then edit3.Text:='输入有误'
else if x<=100 then z:=(x-y)*0.05
else if x<=2000 then z:= (x-y-500)*0.1+500*0.05-25
else if x<=5000 then z:= (x-y-2000)*0.15+(2000-500)*0.1+500*0.05-125
else if x<=20000 then z:=(x-y-5000)*0.20+(5000-2000)*0.15+(2000-500)*0.1+500*0.05-375
else if x<=40000 then z:=(x-y-20000)*0.25+(20000-5000)*0.2+(5000-2000)*0.15+(2000-500)*0.1+500*0.05-1375
else if x<=60000 then z:=(x-y-40000)*0.3+(40000-20000)*0.25+(20000-5000)*0.2+(5000-2000)*0.15+(2000-500)*0.1+500*0.05-3375
else if x<=80000 then z:=(x-y-60000)*0.35+(60000-40000)*0.3+(40000-20000)*0.25+(20000-5000)*0.2+(5000-2000)*0.15+(2000-500)*0.1+500*0.05-6375
else if x<=100000 then z:=(x-y-80000)*0.4+(80000-60000)*0.35+(60000-40000)*0.3+(40000-20000)*0.25+(20000-5000)*0.2+(5000-2000)*0.15+(2000-500)*0.1+500*0.05-10375
else
z:=(x-y-100000)*0.45+(100000-80000)*0.4+(80000-60000)*0.35+(60000-40000)*0.3+(40000-20000)*0.25+(20000-5000)*0.2+(5000-2000)*0.15+(2000-500)*0.1+500*0.05-15375;
edit3.Text:=floattostr(z);
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
close;
end;
end.
这是我写的一个计算个人所得税的程序,怎么不能运行啊,一运行就提示:I/Oerror.怎么回事啊,急死我了!请各位大哥帮帮忙,指点一下小弟,小弟感激不尽!