浙江理工大学vb课后练习八答案.doc

  1. 1、本文档共3页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
浙江理工大学vb课后练习八答案

第四节 教材习题解答 一、判断题 12.× 3.× 4.√ 5.√ 6.× 7.× 8.√ 9.× 10.√ 二、选择题 12.C 3.B 4.D 5.B 6.C 7.B 8.A 三、填空题 12. 不能 3. Write# 4. Close# 四、程序阅读题Private Sub Command1_Click() Dim i As Integer, j As Integer, a(4, 5) As Single, max As Single Open aaa.txt For Input As #1 For i = 1 To 4 For j = 1 To 4: Input #1, a(i, j): Next j Next i Close #1 Open bbb.txt For Output As #1 For i = 1 To 4 max = a(i, 1) For j = 2 To 4 If Abs(a(i, j)) Abs(max) Then max = a(i, j) Next j For j = 1 To 4 a(i, j) = a(i, j) / max If j 4 Then Write #1, a(i, j), Else Write #1, a(i, j) Next j Next i Close #1 End Sub 题2.程序代码如下 Private Sub Command1_Click() Dim xm As String,xh As String,c1 As Byte,k As Byte,c2 As Byte,c3 As Byte Open score.txt For Input As #1 Open bad.txt For Output As #2: Open pass.txt For Output As #3 Do While Not EOF(1) Input #1, xm, xh, c1, c2, c3 k = 0: If c1 = 60 Then k = k + 1 If c2 60 Then k = k + 1 If c3 60 Then k = k + 1 If k 2 Then Write #3,xm,xh,c1,c2,c3 Else Write #2,xm,xh,c1,c2,c3 Loop Close End Sub 题3.程序代码如下 Private Sub Command1_Click() Dim mc As String, lb As String, pp As String, sl As Integer Open kucun.txt For Input As #1 Open temp.txt For Output As #2 Do While Not EOF(1) Input #1, mc, lb, pp, sl If sl 0 Then Write #2, mc, lb, pp, sl Loop Close Kill kucun.txt: Name temp.txt As kucun.txt End Sub 题4.程序代码如下 Dim x1 As Single, y1 As Single, x2 As Single, y2 As Single, k As Byte Private Sub Command1_Click() On Error GoTo pp Open record.txt For Input As #1 Do While Not EOF(1) Input #1, k, x1, y1, x2, y2 If k=1 Then P2.Line (x1,y1)-(x2,y2) Else P2.Line (x1,y1)-(x2,y2),,B Loop Close #1 Exit Sub pp: MsgBox 文件为空,请先在P1中绘制图形 End Sub Private Sub P1_MouseDown(Button As Integer, Shift As Integer, _ X As Single, Y As Single) x1 = X: y1 = Y End Sub Private Sub P1_MouseUp(Button As Integer, Shift As

文档评论(0)

qwd513620855 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档