【VB开源代码栏目提醒】:网学会员,鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“VB程序设计第三版实验C答案(全) - 编程语言”一文,供大家参考学习!
VB??????ò??è????????????°????????éC????°????¨???????? 1 Private Sub Command1_Click Dim x y x ValText1.Text If x 1000 Then y x ElseIf x 2000 Then y 0.9 x ElseIf x 3000 Then y 0.8 x Else y 0.7 x End If Print y End Sub Private Sub Command2_Click x ValText1.Text Select Case x Case Is 1000 y x Case Is 2000 y 0.9 x Case Is 3000 y 0.8 x Case Else y 0.7 x End Select Print y End Sub 2 Private Sub Command1_Click Dim x y x ValText1.Text If x 10 Then y 30 ElseIf x 50 Then y 2.5 x ElseIf x 75 Then y 2 x Else y 150 End If Print y End Sub Private Sub Command2_Click x ValText1.Text Select Case x Case Is 10 y 30 Case Is 50 y 2.5 x Case Is 75 y 2 x Case Else y 150 End Select Print y End Sub 3 Private Sub Command1_Click Dim x y z x InputBoxinputx y InputBoxinputy z InputBoxinputz Print x y z Print ??????ò??° x y z If x y Then t x: x y: y t If x z Then t x: x z: z t If y z Then t y: y z: z t Print ??????ò??ó x y z End Sub 4 Private Sub Command1_Click Dim x y z x IntRnd 2 16 1 y IntRnd 2 16 1 z IntRnd 2 16 1 Print x y z Print ??????ò??° x y z If x y Then t x: x y: y t If x z Then t x: x z: z t If y z Then t y: y z: z t Print ??????ò??ó x y z End Sub 5 Private Sub Text2_LostFocus Dim m n y m ValText1 n ValText2 If n Mod 2 0 Then MsgBox ????????±?????????????????? Text2 Text2.SetFocus Else y n / 2 - m If y 0 Then MsgBox ????????±??????????????????2±?????????????????????????? Text2 Text2.SetFocus Else x m - y Label1 x Label2 y End If End If End Sub 6 Private Sub Command1_Click Dim a b c x1 x2 a ValText1.Text b ValText2.Text c ValText3.Text If b 2 - 4 a c 0 Then MsgBox ??????????ù ElseIf b 2 - 4 a c 0 Then x1 -b / 2 a x2 -b / 2 a Text4.Text x1 Text5.Text x2 Else x1 -b Sqrb 2 - 4 a c / 2 a x2 -b - Sqrb 2 - 4 a c / 2 a Text4.Text x1 Text5.Text x2 End If End Sub Private Sub Command2_Click End End Sub 7 Private Sub Command1_Click Dim a b c x1 x2 a ValText1.Text b ValText2.Text c ValText3.Text If b 2 - 4 a c 0 Then MsgBox ??????????ù ElseIf b 2 - 4 a c 0 Then x1 -b / 2 a x2 -b / 2 a Text4.Text x1 Text5.Text x2 Else x1 -b Sqrb 2 - 4 a c / 2 a x2 -b - Sqrb 2 - 4 a c / 2 a Text4.Text x1 Text5.Text x2 End If End Sub Private Sub Command2_Click End End Sub 8 Private Sub Command1_Click Dim a b c x1 x2 a ValText1.Text b ValText2.Text c ValText3.Text If b 2 - 4 a c 0 Then MsgBox ??????????ù ElseIf b 2 - 4 a c 0 Then x1 -b / 2 a x2 -b / 2 a Text4.Text x1 Text5.Text x2 Else x1 -b Sqrb 2 - 4 a c / 2 a x2 -b - Sqrb 2 - 4 a c / 2 a Text4.Text x1 Text5.Text x2 End If End Sub Private Sub Command2_Click End End Sub