资源描述:
《数据库技术及应用 答案 实验一》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、sy1-1PublicClassForm1PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickTextBox2.Text=TextBox1.SelectedTextTextBox2.Font=TextBox1.FontEndSubPrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesBu
2、tton2.ClickTextBox1.Font=NewFont("隶书",25)EndSubPrivateSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.ClickTextBox1.Font=NewFont("幼圆",15)EndSubEndClassSy1-2PublicClassForm1DimxAsSingle,yAsSingle,z%PrivateSubForm1_Load(ByValsenderAsSys
3、tem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadTextBox1.Focus()EndSubPrivateSubTextBox1_LostFocus(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesTextBox1.LostFocusx=Val(TextBox1.Text)IfInt(x)-x<>0ThenMsgBox("不是一个整数")TextBox1.Text=""EndIfEndSubPrivateSubTextB
4、ox2_LostFocus(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesTextBox2.LostFocusy=Val(TextBox2.Text)IfInt(y)-y<>0ThenMsgBox("不是一个整数")TextBox2.Text=""EndIfIfyMod2=1ThenMsgBox("不是一个偶数")TextBox2.Text=""EndIfEndSubPrivateSubTextBox3_KeyPress(ByValsenderAsObject,ByValeAs
5、System.Windows.Forms.KeyPressEventArgs)HandlesTextBox3.KeyPressIfy-2*x<0ThenMsgBox("不存在")EndIfz=y-2*xz=z/2TextBox3.Text=Str(z)+""+Str(x-z)EndSubEndClassSy1-3ImportsSystem.MathPublicClassForm1PrivateSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)Han
6、dlesButton3.ClickEndEndSubPrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickTextBox1.Text=""TextBox2.Text=""TextBox3.Text=""TextBox4.Text=""TextBox5.Text=""EndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSys
7、tem.EventArgs)HandlesButton1.ClickDima,b,cAsDoublea=Val(TextBox1.Text)b=Val(TextBox2.Text)c=Val(TextBox3.Text)Ifb*b-4*a*c<0ThenTextBox4.Text=Format(-b/(2*a),"0.00")&"+"&Format(Sqrt(-b*b+4*a*c)/(2*a),"0.00")&"i"TextBox5.Text=Format(-b/(2*a),"0.00")&"-"&Format(Sqrt(-b*b+4
8、*a*c)/(2*a),"0.00")&"i"ElseTextBox4.Text=Format((-b+Sqrt(b*b-4*a*c))/(2*a),"0.00")TextBox5.Text=Format((-b-Sqr