大一计算机课后习题答案.docx
《大一计算机课后习题答案.docx》由会员分享,可在线阅读,更多相关《大一计算机课后习题答案.docx(30页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、3.4Private Sub Command 1 _Click()Image 1.Width = Image 1.Width * 1.2Image 1 .Height = Image 1.Height * 1.2End SubPrivate Sub Command2_Click()Image 1 .Width = Image 1 .Width / 1.2Image 1.Height = Image 1.Height / 1.2End SubPrivate Sub Command3_Click()Image 1 .Width = Form 1. WidthImage 1.Height = For
2、m 1.HeightEnd SubPrivate Sub Form_Load()Image 1.Left = 0Image l.Top = 0Image 1.Picture = LoadPicture(App.Path & back.jpg) End Sub5 Formla I: S放大缩小全屏3. 5Dim mleft As LongPrivate Sub Command 1 _Click()Timer 1.Enabled = TrueEnd SubQ FormlCD30以内满是勾股定理的数值组合4.12Private Sub Form_Click()Dim m As Integer, n
3、As Integerm = CInt(Val(InputBox(”请输入计算范围的初值”) n = CInt(Val(InputBox(请输入计算范围的终值”) For i = m To ns = 0For j = 1 To i - 1If i Mod j = 0 Then s=s+jEnd IfNext jIf s = i Then Print iNext iEnd Sub4.13Private Sub Form_Click()Dim a As String, c As StringDim b As Integera=InputBox,请输入学生姓名”) b=InputBox(”请输入学生成
4、绩”) Select Case bCase Is = 39c = Fail”Case Is = 49c = PoorCase Is = 59c 二“ Fair”Case Is = 79c 廿Good”Case Elsec = Very Good11End SelectPrint姓名:&aPrint”成绩:&bPrint”评语:” &cEnd Sub4.14Private Sub Command 1 _Click()Dim a As Integera = Val(Textl.Text)If a 99 Thenerror 1二MsgBox(您输入的不是两位正整数,请重新输入”)ElseFori =
5、 10 To 99al=a10 + (aModl0)*10il = i10 + (i Mod 10)* 10If(a + i = al +il)And (al 9) And (il 9) ThenLabel2.Caption = Label2.Caption & Chr(13)&a& i & ”廿 & al & ilForm 1.Height = Label2.Height + Label2.Top + 1000End IfNextEnd IfEnd Sub:输入一个两位的正整数查找符合条件的对调数4.15Dim a, b, s As DoubleDim flag, com As Intege
6、rPrivate Sub Commandl_Click()If flag = 0 ThenText 1.Text = Text 1.Text & Command 1 .Caption a = Val(Textl.Text)ElseTextl.Text = nnflag = 0Text 1.Text = Textl.Text & Command 1 .Caption a = Val(Textl.Text)End IfEnd SubPrivate Sub Command2_Click()If flag 二 0 ThenTextl.Text 二 Textl.Text & Command2.Capti
7、on a = Vai (Textl.Text)ElseTextl.Text = ,nflag = 0Textl.Text = Textl.Text & Command2.Caption a = Vai (Textl.Text)End IfEnd SubPrivate Sub Command3_Click()If flag = 0 ThenText 1.Text = Textl.Text & Command3.Caption a = Val(Textl.Text)ElseTextl.Text = nnflag = 0Text 1.Text = Text 1.Text & Command3.Cap
8、tion a = Val(Textl.Text)End IfEnd SubPrivate Sub Command4_Click()If flag = 0 ThenText 1.Text = Text 1.Text & Command4.Captiona = Vai (Text 1.Text)ElseTextl.Text = nnflag = 0Textl.Text = Textl.Text & Command4.Caption a = Vai (Textl.Text)End IfEnd SubPrivate Sub Command5_Click()If flag = 0 ThenTextl.T
9、ext = Textl.Text & Command5.Caption a = Vai (Textl.Text)ElseTextl.Text = ,1nflag = 0Textl.Text = Textl.Text & Command5.Caption a = Val(Textl.Text)End IfEnd SubIf flag = 0 ThenText 1.Text = Text 1.Text & Command6.Caption a = Vai (Text 1.Text)ElseTextl.Text = nnflag = 0Textl.Text = Textl.Text & Comman
10、d6.Caption a = Val(Textl.Text)End IfEnd SubPrivate Sub Command7_Click()If flag = 0 ThenTextl.Text = Textl.Text & Command7.Caption a = Val(Textl.Text)ElseTextl.Text =nnflag = 0Textl.Text = Textl.Text & Command7.Caption a = Val(Textl.Text)End IfEnd SubPrivate Sub Command8_Click()If flag = 0 ThenTextl.
11、Text = Textl.Text & Command8.Caption a = Val(Textl.Text)ElseTextl.Text =flag = 0Text 1 .Text = Textl.Text & Command8.Caption a = Val(Textl.Text)End IfEnd SubPrivate Sub Command9_Click()If flag = 0 ThenTextl.Text = Textl.Text & Command9.Captiona = Val(Textl.Text)ElseTextl.Text = nnflag = 0Text 1.Text
12、 = Text 1.Text & Command9.Captiona = Val(Textl.Text)End IfEnd SubPrivate Sub Command 10_Click()If flag = 0 ThenText 1.Text = Text 1.Text & Command 10.Caption a = Val(Textl.Text)ElseText 1 .Text =”flag = 0Text 1.Text = Text 1.Text & Command 10.Caption a = Vai (Text 1.Text)End IfEnd SubPrivate Sub Com
13、mand 1 l_Click()If flag = 0 ThenText 1.Text = Text 1.Text & Command 11 .Caption a = Vai (Text 1.Text)ElseText 1 .Text 二”flag = 0Text 1.Text 二 Text 1.Text & Command 11 .Caption a = Vai (Text 1.Text)End IfEnd SubPrivate Sub Command 12_Click()Select Case coma = b + aText 1.Text = aflag = 1Case 1 a = b
14、- aText 1.Text = aflag = 1Case 2 a = b * aText 1,Text = aflag = 1Case 3 a = b / aText 1.Text = aflag = 1End SelectEnd SubPrivate Sub Command 13_Click()b = aflag = 1 com = 1End SubPrivate Sub Command 14_Click()b = aflag = 1com = 2End SubPrivate Sub Command 15_Click()b = aflag = 1com = 3End Subb = a f
15、lag = 1 com = 4End SubPrivate Sub Form_Click()Dim a(l To 20)For i = 1 To 20a(i) = InputBox(请输入第 & i & “个元素”)Next iFor i = 1 To 20Print a(i); ”;Next iPrintFor i = 1 To 10t = a(i)a(i) = a(21 - i)a(21 - i) = tNext iFor i = 1 To 20Print a,Next iEnd SubPrivate Sub Form_Click()Dim a(l To 10, 1 To 10)For i
16、 = 1 To 10For j = 1 To 10If i = j Thena(i,j)= 1Elself i + j = 11 Thena(i,j)= 1Elsea(i, j) = 0End IfNext jNext iFor i = 1 To 10For j = 1 To 10Print a(i, j);Next jPrintNext iEnd SubPrivate Sub Form_Click()Dim a() As Integern = InputBox( 请输入 nn)m = InputBox(请输入 m”)Print ”数组为“ &n& ”行”&m& ”列”ReDim a(n, m
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 大一 计算机 课后 习题 答案
限制150内