欢迎来到天天文库
浏览记录
ID:59327505
大小:16.50 KB
页数:4页
时间:2020-09-04
《初三1000米成绩转换工具代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、unitUnit1;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls;typeTForm1=class(TForm)Button1:TButton;Edit1:TEdit;Edit2:TEdit;procedureButton1Click(Sender:TObject);functionTForm1.ChengJiDJ(FS:real):string;private{Privatedeclarations}public{Publicdeclaratio
2、ns}end;varForm1:TForm1;implementation{$R*.dfm}functionTform1.ChengJiDJ(FS:real):string;//自定义函数输入成绩返回成绩等级beginif(FS<=3.30)thenresult:='15'elseif(FS<=3.36)and(FS>3.30)thenresult:='14.5'elseif(FS<=3.38)and(FS>3.36)thenresult:='14'elseif(FS<=3.42)and(FS>3.38)thenresult:='13.5'elseif(FS<=3.46)and(FS>3.42
3、)thenresult:='13'elseif(FS<=3.50)and(FS>3.46)thenresult:='12.5'elseif(FS<=3.54)and(FS>3.50)thenresult:='12'elseif(FS<=3.58)and(FS>3.54)thenresult:='11.5'elseif(FS<=4.02)and(FS>3.58)thenresult:='11'elseif(FS<=4.06)and(FS>4.02)thenresult:='10.5'elseif(FS<=4.10)and(FS>4.06)thenresult:='10'elseif(FS<=4.
4、15)and(FS>4.10)thenresult:='9.5'elseif(FS<=4.20)and(FS>4.15)thenresult:='9'elseif(FS<=4.25)and(FS>4.20)thenresult:='8'elseif(FS<=4.30)and(FS>4.25)thenresult:='7'elseif(FS<=4.35)and(FS>4.30)thenresult:='6'elseif(FS<=4.45)and(FS>4.35)thenresult:='5'elseif(FS<=4.55)and(FS>4.45)thenresult:='4'elseif(FS<
5、=5.05)and(FS>4.55)thenresult:='3'elseif(FS<=5.15)and(FS>5.05)thenresult:='2'elseif(FS<=5.25)and(FS>5.15)thenresult:='1'elseif(FS>5.25)thenresult:='0'end;procedureTForm1.Button1Click(Sender:TObject);beginself.Edit2.Text:=ChengJiDJ(StrToFloat(Edit1.Text));end;end.
此文档下载收益归作者所有