【VB开源代码栏目提醒】:以下是网学会员为您推荐的VB开源代码-《VB程序设计基础》习题答案 - 其它资料,希望本篇文章对您学习有所帮助。
ltVisual Basicgt程序设计基础 3 Intx 1 4 IntRndP16 习题一 101200 一,判断题 1,错 2,对 3,错 4, 3. Private Sub Form_Click错 5,6,7,对 Dim a As Integer b As Integer 二,单选题 1,B 2,B 3,D 4,A 5, Dim c As Integer y As LongD 6,B 7,B 8C 9D a InputBoxquot请输入 a 的值quot 三 程序
设计题 b InputBoxquot请输入 b 的值quot 5 Private Sub Command1_Click c InputBoxquot请输入 c 的值quot Form1.FontName quot宋体quot ya22b22c2 Form1.Print quot中文字体宋体quot Print quot y quot y End Sub End Sub Private Sub Command2_Click 4。
(1) F (2) T 3 F 4 T Form1.FontName quot楷体_GB2312quot 5. (1)1ltx And xlt12 (2)T3ltgtV-2 Form1.Print quot中文字体楷体quot And TVgt100 End Sub (3) ab gt c or a-c lt c (4) agt0 And Intaa And bgt0 And Private Sub Command3_Click Intbb or alt0 And blt0 Form1.FontName quot仿宋_GB2312quot (5) xlty Or xgtz Form1.Print quot中文字体仿宋quot (6) a0 And bltgt0 or altgt0 And b0 End Sub 四 编程题 1. Private Sub Form_Click P42 习题二 Dim a As Integer b As Integer 一,判断题 Dim c As Integer y As Single 12,3, 7,10, 对 a InputBoxquot请输入正整数 a 的值quot 4,5,6,8,9,11,12,13,14 错 b InputBoxquot请输入正整数 b 的值quot二,单选题 c InputBoxquot请输入正整数 c 的值quot 1,A 2,C 3,C 4,B 5,B y a b c / 3 6,A 7,B 8,C 9,B 10,C Print quot 平均值 y quot y 11,C 12,D 13,B 14,A 15,D End Sub 16,B 17,B 18,C 19,B 20,B 2. Private Sub Form_Click 21,B 22,D 23,A 24,C 25,B Dim r As Integer s As Single 26,A 27,D 28,B Const Pi 3.14159三,简答题 r InputBoxquot输入圆半径quot quot输入quot 10 1. 1 2 Cosalfa Sinalfa/ 2 a s Pi r r 2 Sqr ss–as–b s - c MsgBox quot圆面积 Area quot amp Strs 3 A2 BCX Y / AB End Sub 4 2 3.14159r Exp-5 Logx 5 1/ x 1/y1 P78 习题三 6 k / 1 a Exp-bx 一, 1,A 2,B 3,B 4,A 5,C 7 5 6x / 3 x2-1 - 2x 8 Sqr y3 3 a2b2 / x2y2 二, 1, 37,55,64,28,19 2. 1 ab Mod c 2 2, yKIGECA SqrAbsx 3, 1 121 ii1 12321 Wend 1234321 Print quotyquot y 123454321 End Sub 12345654321 4, cHINA! Y0.386289385475669三, 1, t As Double s1 3. Abstgt1e-5 Private Sub Form_Click sst Dim n As Integer i As Integer flag As Integer s 2 sc As Single t As Integer -1 n InputBoxquot请输入 n 的值:quot s sum 0 3 mn t1 m To n flag -1 SumSumj For i 1 To n Sumi flag -flag tti四, 1, s s flag i / tPrivate Sub Form_Click Next i Dim x As Single f As Single Print quotsquot s x InputBoxquot输入 x: quot End Sub If x lt -5 Then f3xx2x-1 4. ElseIf x lt 5 Then Private Sub Command1_Click f x Sinx 2 x For i 1 To 9 Else For j 1 To i f Sqrx - 5 Logx / Log10 Print i quotquot j quotquot i j End If Next j Label1.Caption f PrintEnd Sub Next i End Sub2. 5.Private Sub Form_Click Private Sub Form_ClickDim i As Integer flag As Integer For i 1 To 5Dim t As Double y As Double Print Tab6 - iy0 For j 1 To 2 i - 1flag 1 Print quotquott 0.5 Next ji1 PrintWhile Abst gt 0.00001 Next i t 1 / i / i 1 For i 4 To 1 Step -1 y y flag t Print Tab6 - i flag -flag For j 1 To 2 i - 1 Print quotquot Min a1: Max a1: s 0 Next j For i 2 To 50 Print If Min gt ai Then Min ai Next i If Max lt ai Then Max aiEnd Sub s s aiP104 练习四 Next i一、 单选题 Print quotmaxquot Max quotminquot Min quotaveragequot 1,D 2C 3 C 4C 5 s / 50 D End Sub 2.二、
程序阅读题 Private Sub Form_Click1, 12 10 9 Dim max As Integer min As Integer2, 0 Dim a As Integer 1 n ValInputBoxquotquot 1 2 3 ReDim an As Integer 2 For i 1 To n3、 div 3 ai IntRnd 100 Print ai三、程序填空题 Next i1、 For i 1 To n Lenstr1 If ai Mod 2 0 Then min ai Else Midstr1 i 1 max ai pj If min ltgt 0 And max ltgt 0 Then Exit For i ltgt p Next i For i 1 To n2、 If ai Mod 2 0 And min gt ai Then l LenSt min ai ai MidSt i 1 ElseIf ai Mod 2 1 And max lt ai p s - 96 Then xp xp 1 ma