浙江农林大学Visual Bacis答案_第1页
浙江农林大学Visual Bacis答案_第2页
浙江农林大学Visual Bacis答案_第3页
浙江农林大学Visual Bacis答案_第4页
浙江农林大学Visual Bacis答案_第5页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

第第 1 章章VB6 0 概述概述 答案答案 一 判断题 1 5 6 10 11 15 二 选择题 1 5 ADBBB 6 10 CACDB 11 14 CDCC 三 程序设计题 略 第第 2 章章 VB6 0 语言基础语言基础 答案答案 一 判断题 1 5 6 10 11 14 二 选择题 1 5 ABCDA 6 10 ABDBB 11 15 AADBB 三 填空题 1 ab e d c b b a 2 2 int 900 rnd 100 3 sin 65 180 3 14159 2 3 14159 sqr x 2 exp y x y 4 BCD 5 6 6 Byte 7 5 5 第第 3 章章 顺序文件顺序文件 一 程序阅读 1 A 2 B 1 C 2 2 12 二 选择题 1 D 2 A 3 C 4 A 6 A 7 A 8 D 三 略 第四章第四章 选择结构程序设计选择结构程序设计 一 选择题 1 A 2 D 3 A 4 B 5 A 6 A 二 程序阅读 1 9 2 w 4 w 13 w 135 w 31 3 s 1 s 2 s 5 s 20 三 程序填空题 1 1 max 2 min 3 c max 4 c min 2 5 x mod 3 2 and x mod 5 3 and x mod 7 4 then 6 text1 text 五 程序设计题 1 Private Sub Command1 Click Dim y As Integer y Val InputBox y If y Mod 4 0 And y Mod 100 0 Or y Mod 400 0 Then Print 是闰年 Else Print 不是闰年 End If End Sub 2 Private Sub Command1 Click Dim a As Integer b As Integer c As Integer t As Integer a Val InputBox a b InputBox b c InputBox c If a b Then t a a b b t If a c Then t a a c c t If b c Then t b b c c t Print a b c End Sub 3 Private Sub Command1 Click Dim x y x Val InputBox x If x 0 And x 3 Then y x x x 6 elseIf 0 x And x 10 And x 2 And x 3 Then y x sin x 2 x else y sqr x 5 log x 4 log 10 End If Print x x y y End Sub 第第 5 章章 循环结构程序设计循环结构程序设计 一 判断题 1 6 二 选择题 1 6 BCCCDA 三 程序阅读 1 88 6886 458864 24588642 2 2 12 3 D 4 1 第一次输入 7 后 7 第 2 次输入 8 后 5 2 2 3 5 四 程序填空 1 while n30 2 k 0 3 sum 1 k k 1 4 len str1 5 length 1 6 mid str1 i 2 7 sum 0 8 Sign 1 9 For I 2 to 19 10 Sign sign 11 While m len str1 2 1 12 mid str1 m 1 1 13 mid str1 len str1 m 1 14 B 15 A 16 D 17 A 五 程序设计 1 Private Sub Command2 Click Dim x As Single s As Single t As Long i As Integer s 0 t 1 n Val InputBox n x Val InputBox x For i 2 To n t t i s s 1 i x t Next i Print s s End Sub 2 Private Sub Command3 Click Dim i As Integer Dim a As Integer b As Integer c As Integer i 100 Do While i 0 0001 Print e e End Sub 4 Private Sub Command4 Click Dim x As Integer k As Integer i As Integer c as integer i 2 c 1 for j 1 to 100 x int rnd 990 10 k Int Sqr x Do While i k Then Print x C c 1 If c mod 5 0 then print End If Next j Print 总共有 str c 个素数 End Sub 5 Private Sub Command5 Click Dim i As Integer j As Integer For i 1 To 5 Print space 20 i For j 1 To 2 i 1 Print Trim Str i Next j Print Next i For i 6 To 9 Print space 10 i For j 1 To 19 2 i Print Trim Str i Next j Print Next i End Sub 第第 6 章章 数组数组 一 判断题 1 6 二 选择题 1 4 CCAC 三 程序阅读 1 1234 2 11 12 13 14 2122 23 24 3132 33 34 4142 43 44 3 1 2 3 4 sum 10 4 1 4 9 16 25 四 程序填空 1 1 int rnd 90 10 2 i 1 to 30 3 a i a j 4 a i mod 2 1 2 5 a i j 1 6 print 3 7 val txtinput text 8 p 1 9 false 10 prime j 1 11 end if 4 BDA 五 程序设计 1 Private Sub Command1 Click Dim a 100 As single Dim b As Integer Dim i As Integer j As Integer n As Integer t As Integer n 0 For i 1 To 100 a i inputbox If int a i a i Then n n 1 Next i ReDim b n As Integer j 1 For i 1 To 100 If a i int a i Then b j a i j j 1 End If Next i For i 1 To n 1 For j i 1 To n If b i b j Then t b i b i b j b j t End If Next j Next i For i 1 To n Print b i If i Mod 5 0 Then Print Next i End Sub 2 Private Sub Command2 Click Dim a 1 to 5 1 to 5 As Integer i j Dim sum1 As Integer sum2 As Integer sum1 0 sum2 0 Print 数组 For i 1 To 5 For j 1 To 5 a i j Int Rnd 9 1 Print a i j Next j Print Next i For i 1 To 5 For j 1 To 5 If i 1 Or j 1 Or i 5 Or j 5 Then sum1 sum1 a i j If i j Or i j 6 Then sum2 sum2 a i j Next j Next i Print 数组靠边元素之和为 sum1 Print 数组对角线元素之和为 sum2 End Sub 3 Private Sub Command1 Click Dim a 1 To 20 As Integer i As Integer t As Integer For i 1 To 20 a i Int Rnd 90 10 Next i Print 交换前的数为 For i 1 To 20 Print a i If I mod 10 0 then print Next i Print For i 1 To 10 t a i a i a 21 i a 21 i t Next i Print 交换后的数为 For i 1 To 20 Print a i If i mod 10 0 then print Next i End Sub 第第 7 章过程章过程 答案答案 一 判断题 1 10 二 选择题 1 5 AACDB 6 10 DBCAB 三 程序阅读题 1 3 12 3 2 32 64 16 64 8 64 4 64 3 3 5 11 19 26 59 4 5 1 5 2 四 程序填空题 1 temp 1 2 temp 3 nfactor i 4 sum 5 C A 7 A 8 B 9 10 1 2 五 上机测试题 1 1 Function chu n As Integer As boolean If n 17 n 17 And n 37 n 37 Then Chu true End If End Function Private Sub Form DblClick Dim i As Integer For i 100 To 10000 If chu i true then print I Next i End Sub 2 2 Private Function fsum n As Integer As Integer Dim i As Integer x As Integer y As Integer z As Integer x n 100 y n x 100 10 z n Mod 10 fsum x y z End Function 3 Function ave x As Integer n As Integer Dim i As Integer s As Long For i 1 To n s s x i Next i ave s n End Function Private Sub Command1 Click Dim a 1 To 10 As Integer i As Integer For i 1 To 10 a i Val inputobx Print a i Next i Print text1 Text 数组的平均值为 ave a 10 End Sub 第第 8 章章 常用控件常用控件 答案答案 一 断题 1 15 二 选择题 1 5 BCDAB 6 10 CBACD 11 15 ABCBC 16 20 AABAA 21 23 ADD 三 填空题 1 Enabled Visible 2 文本框和列表框 3 Change 4 Command1 setfoucs 5 Timer 6 MaxLength 四 程序阅读题 1 D 2 ABB 3 463789 4 李子 苹果 橘子 葡萄 柚子 香蕉 5 6 15 28 45 6 1 1 2 3 3 6 4 10 5 15 五 程序填空题 1 1 Label1 left 2 label1 width 2 1 List1 ListIndex 0 或者写成 1 2 List1 RemoveItem List1 ListIndex 3 Text1 Text 4 List1 AddItem Text1 Text 3 1 Text2 Enabled False 2 print i 3 Text2 Enabled False 4 keyascii 13 5 Command1 Enabled True 4 1 Timer1 Enabled True 2 x 3600 3 x h 3600 60 或 x mod 3600 60 4 x x 1 5 A D B C 6 C A B A 7 B A A D 五 程序设计题 1 Private Sub Text1 Change Dim f As Single c As Single c Val Text1 Text f 9 5 c 32 Text2 Text f End Sub Private Sub Text1 KeyPress KeyAscii As Integer If KeyAscii 57 And KeyAscii 46 Then KeyAscii 0 End If End Sub 2 Private Sub Command1 Click If Text1 Text Then MsgBox 请先输入添加项 Else List1 AddItem Text1 Text End If End Sub Private Sub Command2 Click If List1 ListIndex 0 Then MsgBox 请选择一删除项 Else List1 RemoveItem List1 ListIndex End If End Sub Private Sub Command3 Click If List1 ListIndex 0 Then MsgBox 请选择一修改项 Else Text1 Text List1 Text End If Command4 Enabled True End Sub Private Sub Command4 Click Dim a As Integer If List1 Text Text1 Text Then MsgBox 请先修改此项 Else a List1 ListIndex List1 RemoveItem List1 ListIndex List1 AddItem Text1 Text a End If End Sub Private Sub Form Load Command4 Enabled False End Sub 3 Dim t As Integer Private Sub Timer1 timer label1 0 Caption Time t t 1 h t 3600 m t h 3600 60 s t Mod 60 label1 1 Caption h label1 2 Caption m label1 3 Caption s End Sub Private Sub command1 click timer1 Enabled True End Sub Private Sub Form Load timer1 Enabled False timer1 Interval 1000 End Sub 4 Private Sub Check1 Click If Check1 Value 1 Then Label1 FontBold True Else Label1 FontBold False End If End Sub Private Sub Check2 Click If Check1 Value 1 Then Label1 FontItalic True Else Label1 FontItalic False End If End Sub Private Sub Option1 Click Label1 FontName 宋体 End Sub Private Sub Option2 Click Label1 FontName 楷体 gb2312 End Sub 5 Private Sub Command1 Click For i 0 To List1 ListCount 1 If List1 List i Mod 2 0 Then List2 AddItem List1 List i End If Next i For i 0 To List2 ListCount 2 For j i 1 To List2 ListCount 1 If List2 List i List2 List j Then t List2 List i List2 List i List2 List j List2 List j t End If Next j i End Sub Private Sub Form Load For i 1 To 10 List1 AddItem Int Rnd 900 100 Next i End Sub 第 9 章习题集答案 一 判断题 二 选择题 DACAA 第第 10 章章 图形操作与图形控件图形操作与图形控件 答案答案 一 判断题 1 5 6 11 二 选择题 1 5 BAADA 6 10 BAACB 11 14 CCDD 11 题 A 和 C 均可 三 填空题

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论