欢迎来到天天文库
浏览记录
ID:56018380
大小:68.50 KB
页数:15页
时间:2020-03-14
《delphi编写计算器实验报告一.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、实验报告学号:080304041姓名:林燕玉专业:08信管班级:____第8周课程名称面向对象程序设计实验课时6实验项目简易计算器实验时间2010-4-9至2010-4-23实验目的1、掌握DELPHI函数和过程的定义及使用方法2、熟练使用全局变量和局部变量进行程序设计实验环境1、WindowsXp2、DELPHI7实验内容和完成情况实验内容:unitU4_9;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls;typeTForm1=clas
2、s(TForm)Button1:TButton;Button2:TButton;Button3:TButton;Button4:TButton;Button5:TButton;Button6:TButton;Button7:TButton;Button8:TButton;Button9:TButton;Button10:TButton;Button11:TButton;Button12:TButton;Button13:TButton;Button14:TButton;Button15:TButton;Button16:TButton;Button17:TButton;Button
3、18:TButton;Button19:TButton;edit1:TEdit;procedureButton5Click(Sender:TObject);procedureButton6Click(Sender:TObject);procedureButton7Click(Sender:TObject);procedureButton9Click(Sender:TObject);procedureButton10Click(Sender:TObject);procedureButton11Click(Sender:TObject);procedureButton13Click(S
4、ender:TObject);procedureButton14Click(Sender:TObject);procedureButton15Click(Sender:TObject);procedureButton17Click(Sender:TObject);procedureButton19Click(Sender:TObject);procedureButton1Click(Sender:TObject);procedureButton2Click(Sender:TObject);procedureButton8Click(Sender:TObject);procedure
5、Button12Click(Sender:TObject);procedureButton16Click(Sender:TObject);procedureButton4Click(Sender:TObject);procedureButton18Click(Sender:TObject);procedureButton3Click(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm1:TForm1;num1,num2:real;ittype:integer;flag:b
6、oolean=true;new:boolean=true;implementation{$R*.dfm}procedureTForm1.Button5Click(Sender:TObject);beginifnewthenedit1.Text:=edit1.Text+'7'elsebeginedit1.clear;edit1.Text:=edit1.Text+'7';flag:=true;new:=true;end;end;procedureTForm1.Button6Click(Sender:TObject);beginifnewthenedit1.Text:=edit1.Tex
7、t+'8'elsebeginedit1.clear;edit1.Text:=edit1.Text+'8';flag:=true;new:=true;end;end;procedureTForm1.Button7Click(Sender:TObject);beginifnewthenedit1.Text:=edit1.Text+'9'elsebeginedit1.clear;edit1.Text:=edit1.Text+'9';flag:=true;new:=true;
此文档下载收益归作者所有