【VB开源代码栏目提醒】:网学会员为广大网友收集整理了,VB程序设计作业参考答案 - 职业资格,希望对大家有所帮助!
VB程序设计 第 1 页 共 3 页 《VB程序设计》作业参考答案 一选择题 15 ABC CB 6—10 CCA DC 1115 ABC DB 1520CDA CB 2125DBD CC 2530DAC AA 3135 DAC AA 3640 BCC CD 4145 CCC AC 4650DDB AD 5155 ACA CD 5660 BCA DA 6165 BAADB 6670DBDAC 7172BB 二填空题 1 E 2 程序代码 3 CmdDisplay.Visible False 4 taj 5 And 6 回车符 7 text2.setfocus 8 3 9 DB:BC:CD 10 Random 11事件过程 12 打开对话框 13 3 14 aij0 15 L1.text 16 Put 17 True 18 I MOD 40 19 AaBbCc 20INTRnd100 arr 21Output Write 1StuNoStuNameStuEng 三编程题 1. Option Base 1 Private Sub Form_click Dim a3 As Integer m As Integer Do While m -1 And i 3 m InputBox请输入第 i 1 条边 i i 1 ai m If ai 0 Then MsgBox 输入错误请重新输入 i i - 1 End If Loop If a1 a2 a3 And Absa1 - a2 a3 Then s a1 a2 a3 / 2 s Sqrs s - a1 s - a2 s - a3 Print 三角形的面积是 s Else MsgBox 三条边不能构成三角形 End VB程序设计 第 2 页 共 3 页 End If End Sub 2. Option Base 1 Private Sub Form_click Dim a b a Array2 8 7 6 4 28 70 25 b Array79 27 32 41 57 66 78 80 Dim c8 For i 1 To 8 ci ai bi Print ci Next i End Sub 3. Private Sub Form_KeyDownKeyCode As Integer Shift As Integer Print spc3 ChrKeyCode spc3 HexKeyCode spc3 OctKeyCode spc3 KeyCode End Sub Private Sub Form_Load Print Show Print spc3 按键 spc3 16进制 spc3 8进制 spc3 10进制 Print End Sub 4. VB程序设计 第 3 页 共 3 页 Dim a3 As Long s As Long p As Long 通用-声明 Sub Sun As Long 通用sub p 1 For i 1 To n p p i Next i End Sub Function Fn As Long As Long 通用Function p 1 For i 1 To n p p i Next i F p End Function Private Sub Command1_Click s 0 For i 1 To 3 ai InputBox请输入第 i 个数的值: Call Suai s s p Next i Print 用Sub过程求得 a1 a2 a3 s End Sub Private Sub Command2_Click s 0 For i 1 To 3 ai InputBox请输入第 i 个数的值: s s Fai Next i Print 用Function过程求得 a1 a2 a3 s End Sub Private Sub Command3_Click End End Sub