收藏 分享(赏)

学生复习题vb-2011(Student review questions vb-2011).doc

上传人:dreamzhangning 文档编号:2791512 上传时间:2018-09-27 格式:DOC 页数:38 大小:33.49KB
下载 相关 举报
学生复习题vb-2011(Student review questions vb-2011).doc_第1页
第1页 / 共38页
学生复习题vb-2011(Student review questions vb-2011).doc_第2页
第2页 / 共38页
学生复习题vb-2011(Student review questions vb-2011).doc_第3页
第3页 / 共38页
学生复习题vb-2011(Student review questions vb-2011).doc_第4页
第4页 / 共38页
学生复习题vb-2011(Student review questions vb-2011).doc_第5页
第5页 / 共38页
点击查看更多>>
资源描述

1、学生复习题 vb-2011(Student review questions vb-2011)Chapter one1) compared with the traditional programming language, the most prominent feature of Visual Basic is the event driven programming mechanism2) the main window in the Visual Basic 6 integrated environment contains title bar, menu bar, and toolb

2、ar3) the concept of the Visual Basic method is wrong: the method is the response to the event4) in Visual Basic, the data of the object is called attribute5) set the Visible property of the control to see whether the control is visible, and set the Enabled property of the control to make the control

3、 valid6) the ListBox, ComboBox, and TextBox controls contain scroll bars, and the Label control does not contain scrollbar7) the name of an object event can only be specified by the system8) in the design state, when you double-click a control on the form, the open window is the code window9) if you

4、 want to change the title of the form, you need to set the property of Caption; the content displayed by the tag box is determined by the Caption attribute value10) in Visual Basic, the extension of the form file is called FRM11) the Name property of the form specifies the name of the form to identi

5、fy a form12) the basic features of an object are attributes, events, and methods13) in Visual Basic, the data of the object is called attribute14) the statement that can display “VisualBasic form“ in the title bar of form Form1 is Form1.Caption= “VisualBasic form“15) the property of any control is N

6、ame16) when calling the method, the object name can be missing (e.g. form1.print can omit form1)17) the statement that can display “VisualBasic form“ in the title bar of form Form1 is Form1.Caption= “VisualBasic form“18) in the KeyPress event, KeyAscii is the ASCII code value of the key, KeyPress ev

7、ent can identify a key on the keyboard press and release19) determine the property of a control on the left and right position of the form is Left, the upper and lower position of the attribute is Top20) the main function of the Visual Basic form designer is to create user interfaces.21) the value o

8、f the Caption property of the form is the text that is displayed in the title bar of the form22) in a computer, not any number can be accurately expressed23) modifying the properties of objects is usually done in two ways: dynamic modification and static modification24) the property that can change

9、form border line type is BorderStyle25) when the variable is not assigned, the value of the numerical variable is 026) if a text box can display multiline text, the MultiLine attribute should be set as True27) in VB, the Value value of the check box (Check) is three, 0, 1, 2, respectively28) the Ena

10、bled property makes the command button invalid for the commands generated by the user.29) if the Boolean constant value TRUE is assigned to an integer variable, the value of the integer variable is -130) determines the font, font, size, and effect of the text on the control. The attribute is FONT31)

11、 the function that intercepts characters from the left side of the string is Left ()32) the function that can obtain the current system date is Date ()33) the programming method of VB is object-oriented and event driven.34) assume that there is a tag on the form, called Lable1. In order to make the

12、tag transparent and without borders, the correct property is set to Lable1.BackStyle = 0, Lable1.BorderStyle = 035) the result of statement Print “5*5“ is 5*5, and the output of print 5*55/5 is 2536) in Visual Basic, to set the title of the tag in the center, the Alignment property is set to 237) se

13、t a text box on the form, Text1, request only display information, can not input.You should add Text1.Locked= True to the code editing window38) after the program is running, click the mouse on the form, at this time the form will not receive the event is CA MouseDown B MouseUp C Load D ClickSecond

14、chapters1) the Text attribute of the textbox determines the output content. The event that the textbox loses focus is LostFocus, and the Change event is triggered when the Text attribute value changes2) with the following procedures: a$= “BeijingShanghai“B$=Mid (a$, InStr (a$, g) +1, after executing

15、 the above program segment, the value of the variable b$is Shanghai3) the value of the expression (73+1) *3 is 9; the value of the expression 2*32+2*8/4+32 is 31; the value of the expression 5 Mod 3+35*2 is 2; and if a=3, b=5, then the expression (ab) Or (b0) is True4) the output of the following st

16、atement is 12345.68, Print Int (12345.6789*100+0.5) /1005) a two digit is stored in the shaping variable M, where the two bit exchange position, such as 24, becomes 42, and the expression is (M mod 10) *10 + M10)6) the function of statement Dim x As Double statement is to define x as a variable of d

17、ouble precision type7) the Interval attribute to set the timer control Timer event time interval, in order to temporarily close the timer, the timer should be the Enabled property is set to False, if required to set the timer interval is 1 seconds, then its Interval attribute should be equal to 1000

18、. The timer control can only respond to an event whose name is Timer8) in the design phase, when you double-click a control on the form, the open window is the code window9) in Visual Basic, the extension of the form file is.Frm, and the expansion name of the engineering file is.Vbp10) the Name prop

19、erty of the form specifies the name of the form, which is used to identify a form; if you want to change the title of the form, you need to set the property of Caption11) in the text box (Text), to set the font color through the ForeColor attribute; if the requirements from the text box to enter a p

20、assword only display * in a text box, you should set the Passwordchar attribute window in this text box *12) you can use the text property to program if you want to set or return the content in the text box13) set a=10, b=5, c=1, execute statement Print a b C, and then display False on the form14) w

21、ith the following statement: Dim x As Integer, if the value of Sgn (x) is -1, then the value of X is less than 0 integers15) TextBox can display and input text, TextBox object does not have Caption attribute; Label can only display text16) the common event of the command button is a click (Click) ev

22、ent, but there is no DblClick event17) the form itself is an object, as well as a container or carrier for other objects18) after executing the following program segment, the value of the variable C $is Quick BASIC ProgramingA $= “Visual Basic Programing“B $= “Quick“C $= B $ y=524) use random functi

23、on as integer variable x assign a two bit positive integer statement is x= 90*Rnd+1025) the number of operations “on both sides if different types: first, the whole Integer type and operation26) declare a variable length string variable STR with length of 256 characters, Dim STR as String*25627) 44)

24、 in the Visual Basic toolbox, not all controls have width (Width) and height (Height) attributes28) can correctly express the conditions “integer variable x value is greater than or equal to -5 and less than 5“ logic expression is: -5 1 And 3 2 Or 2 3 D Not (1 2)36) if a variable is used directly wi

25、thout definition, then the variable type is Variant37) let x=4, y=8, z=7, the expression xz) Or z=100, then print “OK“, otherwise print “Error“, which means that the single sentence of the conditional statement is:If Fix (A) =A And ABS (A) =100 Then Print “Ok“ Else Print “Error“39) if X is a positiv

26、e real number, the percentile is four into five, and the decimal expression is 0.1*Int (10* (X+0.05),The expression of the third decimal four to five of X is 0.01*Int (100* (X+0.005)40) the output of the following program is TrueA=sqr (3): b=sqr (2): c=ab: Print C41) add a command button to the form

27、, and write the following program:Private Sub Command1Click ()X=1:Y=2:Z=3X=Y:Y=Z:Z=XPrint ZEnd SubAfter the program is executed, the output is 242) draw a command button named Command1 on the form, and then write the following event process:Private Sub Command1_Click ()A$= “VisualBasic“Print String

28、(3, a$)End SubAfter the program is running, click the command button, the content displayed on the form is VVV43) the function used to intercept characters from the left of string is Left (), and a= “Visual Basic“ is used to make the statement “Basic“ of b= “b=Left“ (a, 8,5)44) the following symbol

29、(A) is the legal variable name in the VB program: A AB7 B 7ab C If D a*bc E a#x45) the value of the expression 2*42-2*6/3+32 is 29; the value of the expression 93 Mod 22 is 1; A=7, B=3, C=4,The value of A MOD 3 + B 2 C is 3; the logical expression Not “A“ “E“ and 93 is True;The expression “12345“ “1

30、2345“ Let S= “Peoples Republic of China“, and the expression Left (S, 1) +Right (S, 1) +Mid (S, 3,2) is the value of the Chinese people“;The value of the expression Len (“123 programming ABC“) is 1047) the mathematical relationship between the 3 =3 and x5 And xB is not equal to “Then Printf A“ is no

31、t equal to B“C If A 5, -1,0) is executed, and the value of X is -14) give the results of the following program running(1) x=5Y=-6If Not x0 Then x=y-3 Else y=x+3Print X-Y; Y-X results -3 3(2) 1=4J2=9The results of If J1b) And (c0 Then x=y-3 Else y=x+3Print X-Y; Y-X8) if a=6 is set, then x=IIf (a 5, -

32、1,0) is executed, and the value of X is -19) in the following statement about Select Case Is, the error is DA Case 10 To 100 indicates whether Is is between 10 and 100B Case “ABC“, “ABC“, indicates whether Is is identical to one of the two strings of “ABC“ and “ABC“C Case “X“ indicates whether Is is

33、 a capital letter XD Case -7,0100 indicates whether Is is equal to string “-7“, “0100“10) the property that can change the background color in the check box is Backcolor11) in the following assignment statement, C is wrong.A x=x+1 B x=x+y C x+y=x D x=4 612) the following procedure segments are execu

34、ted: I = 4A=75If a 60 Then I=1If a 70 Then I=2If a 80 Then I=3If a =y Then z=x: z=y B. If x=y Then z=x Else z=yC. z=y: If x=y Then z=x D. If x 0If d C ThenC = C + 1End IfD = InputBox (“enter an integer“)LoopPrint C + DEnd SubAfter the program is running, click the command button, if in the input dia

35、log box in turn enter 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, then the output is 9Fifth chapters1) in the Do Until. Loop, judge the relationship between the expression and the end of cycle cycle is first to determine the cycle expression, when the value of the expression is true at the end of cycle; in the Do

36、 While. Loop, judge the relationship between the expression and the end of cycle cycle is first to determine the cycle expression when the expression value is false at the end of cycle2) the following cyclic structure Do While, if the condition is established, then implements the cyclic body, otherw

37、ise does not execute; Do Until if the condition does not hold, then implements the circulation body, otherwise does not carry outDo While/Until conditionCirculatory bodyLoop3) to make the following For statement cycle 20 times, what is the initial value of the cyclic variable? 33For k= 33 To -5 Step

38、 -24) draw two text boxes on the form (their Name attributes are Text1 and Text2) and a command button (whose Name attribute is Command1), and then write the following event process:Private Sub Command1_Click ()X = 0Do While x, the following description is wrong AA if the “condition“ is a constant o

39、f 0, then the cyclic body is not executed at one timeB “condition“ can be a relational expression, a logical expression or a constantThe Exit Do statement can be used in the C loopD if the “condition“ is always True, the loop body is executed repeatedly7) the output of the following program segments

40、 is (4)X=1Y=4Do Until y4X=x*yY=y+1LoopPrint x8) execute the following program segment, and the value of X isPrivate Sub Command1_Click ()For i=1 To 9A=a + INext IX=Val (I)MsgBox xEnd Sub_. Reference 1010) there is a text box control on the form, requiring each second to display in the text box once,

41、 the current name is TxtTime: a timer control, the name of Timerl time. Procedure for:Private Sub Timer1_ ()TxtTime.text=TimeEnd SubAfter underlining, the content should be filled with Timer11) read the program below:For I = 1 To 3For J = 1 To IFor k = J To 3A=A+1Next KNext JNext IAfter performing t

42、he three cycle above, the value of a is 14Sixth chapters1) the number of elements defined by the following statement is (9)Dim a (-3 to 5) as integer2) array declaration statement:Option Base 0Dim B (-1 To 10,2 To 9,20) As Integer, then there are (2016) elements in the array B3) there is a control i

43、n Visual Basic that combines the properties of text boxes and list boxes, which are combo boxes4) if you want to add list items to the list box, the method you can use is (AddItem)5) when the Value property of the check box is _1_, the check box is selected.6) in order to clear all the contents in t

44、he list box, the method should be used in Clear7) in 3 different types of combo boxes, the combo box that can only select and not input data is a drop-down list box8) if you want to add a list item to the list box, you can use the AddItem, in order to clear all the contents in the list box, you shou

45、ld use the method is Clear9) if there is Dim a (6,3 to 8) as single, the a array contains 42 array elements10) using ReDim statement can not only change the subscript boundary of dynamic array, but also change its dimension10) execute the Click event process of the following Command1 and display BDF

46、 on the formOption Base 0Private Sub Command1_Click ()Dim aA=Array (“a“, “B“, “C“, “d“, “e“, “F“, “g“)Print a (1); a (3); a (5)End Sub11) reading programOption Base 1Private Sub Form_Click ()Dim arr, SumSum = 0Arr = Array (1,3,5,7,9,11,13,15,17,19)For i=1 To 10If arr (I) /3 = arr (I) 3 ThenSum =Sum+

47、arr (I)End IfNext IPrint SumEnd SubAfter the program is run, click the form and enter the result of 271) passing a parameter by value passing through a sub procedure does not affect the variable itself; the address passing parameter can change the value of the variable itself through the child process2) the variables that appear in the process definition are called formal arguments; the variables, constants, and

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 大学课件

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报