VB程序设计第三版实验H答案.doc

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

VB程序设计第三版实验答案(全) 1 Private Sub Command1_Click() Open c:\score For Output As #1 Print #1, 051023, 王海涛, 66 Print #1, 052498, 周文英, 88 Print #1, 050992, 陈建东, 77 Open c:\score1 For Output As #2 Write #2, 051023, 王海涛, 66 Write #2, 052498, 周文英, 88 Write #2, 050992, 陈建东, 77 Close i1 = Shell(NOTEPAD.exe + c:\score, vbNormalNoFocus) i2 = Shell(NOTEPAD.exe + c:\score1, vbNormalNoFocus) End Sub Private Sub Command2_Click() Dim no As String, name As String, s As Integer Open c:\score For Input As #1 Do While Not EOF(1) Line Input #1, linedata List1.AddItem linedata Loop Open c:\score1 For Input As #2 Do While Not EOF(2) Input #2, no, name, s List2.AddItem no name s Loop Close End Sub 2 Private Sub Command1_Click() Dim fib%(0 To 9), i% Open c:\fb.dat For Output As #1 For i = 0 To 9 If i = 0 Or i = 1 Then fib(i) = i Else fib(i) = fib(i - 1) + fib(i - 2) End If Print #1, Fib( i ), fib(i) Next i Close #1 i = Shell(NOTEPAD.exe + c:\fb.dat, vbNormalNoFocus) End Sub Private Sub Command2_Click() Dim st$, n%, sum% Open c:\fb.dat For Input As #1 Do While Not EOF(1) Input #1, st, n sum = sum + n List1.AddItem st = n Loop Close #1 List1.AddItem 合计: sum List1.AddItem 平均: sum / 10 End Sub 3 4 Private Type studtype no As String * 4 name As String * 6 mark As Single End Type Dim student As studtype, stud(1 To 5) As studtype, t As studtype Private Sub Command1_Click() Open d:\score.dat For Random As #1 Len = Len(student) With student .no = 0001 .name = 星期一 .mark = 66 End With Put #1, 1, student With student .no = 0002 .name = 星期二 .mark = 99 End With Put #1, 2, student With student .no = 0003 .name = 星期三 .mark = 88 End With Put #1, 3, student With student .no = 0004 .name = 星期四 .mark = 55 End With Put #1, 4, student With student .no = 0005 .name = 星期五 .mark = 77 End With Put #1, 5, student Close #1 End Sub Private Sub Command2_Click() Open d:\score.dat For Random As #1 Len = Len(stu

文档评论(0)

153****9595 + 关注
实名认证
内容提供者

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

1亿VIP精品文档

相关文档