Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Freshman vb final exam questions
Freshman vb final exam questions

Single-choice questions, true-false questions, fill-in-the-blank questions, programming questions

1) After the following program is run, the output result is ______.

B=1

Do while (b<40)

b=b*(b+1)

Loop

Print b

a) 42

b) 39

c) 6

d) 1 Answer: A

2) Assume that when executing the following program segment, enter 1, 3, and 5 in sequence, and the execution result is _____.

Dim a(4) As Integer

Dim b(4) As Integer

For K =0 To 2

a( K+1) =Val(InputBox("Please enter data: "))

b(3-K) =a(K+1)

Next K

Print b(K)

a) 1

b) 3

c) 5

d) 0 Answer: A

3) After the following program is executed, the value of variable s is ______.

Dim s As long ,x As Integer

s=0:x=1

Do While (x<10)

s=s+x

x=x+2

Loop

Print s

a) 10

b) 25

c) 50

d) 100 Answer: B

4) Write the following event process:

Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)

If Shift=6 And Button=2 Then

Print "Hello"

< p> End If

End Sub

After the program is run, in order to output "Hello" on the form, the following _______ operations should be performed on the form.

a) Press the Shift key and the left mouse button at the same time

b) Press the Shift key and the right mouse button at the same time

c) Press Ctrl and Alt at the same time key and left mouse button

d) Press Ctrl, Alt key and right mouse button at the same time Answer: D

5) When variables x=2, y=5, the following program The output is ____.

Do until y>5

x=x*y

y=y+1

loop

print x

a) 2

b) 5

c) 10

d) 20 Answer: C

6) When the following program is executed, _____ will be displayed in the label box named lblResult.

Private Sub cmdlt_click()

Dim I,R

R=0

For I=1 To 5 Step 1

R=R+I

Next I

lblResult.Caption=Str(R)

End Sub

a) String 15

b) Integer 15

c) String 5

d) Integer 5 Answer: A

7 ) There is an incomplete program segment as follows. If the program is required to execute three cycles, ______ should be entered in the brackets in the program.

X=1

do

x=x+3

print x

loop until(___ )

a) x>=8

b) x<=8

c) x>=7

d) x <=7 Answer: A

8) If the value of integer variable a is 2 and the value of b is 3, then the value of integer variable c after the execution of the following program segment is ______.

If a>5 then

if b<4 then

c=a-b

else

c =b-a

End if

elseif b>3 then c=a*b

else

c=a mod b

End if

a) 2

b) -1

c) 1

d) 6 Answer: A

9) The following statement is provided:

str1=inputbox("input","","exercise")

Enter a string from the keyboard After "example", the value of str1 is ___.

a) "Input"

b) ""

c) "Practice"

d) "Example" Answer: D

10) We create two text boxes on a form, named Text1 and Text2 respectively. The event process is as follows,

Private Sub Text1_change( )

Text2.text=ucase(Text1.text)

End Sub

Input "visual basic" in the Text1 text box, and Text2 will ______.

a) No content is displayed in Text2.

b) Text2 displays "VISUAL BASIC".

c) Text2 displays "visual basic"

d) Text1 displays "visual basic" Answer: B

11) The value of s after running the following program yes_____.

S=0

For x=99 to 1 Step-2

s=s+x

Next x

Print s

a) 100

b) 500

c) 2500

d) 5000 Answer: C < /p>

12) The execution result of the following program is ____.

K=0

For I=1 To 3

a=I^I^K

print a;

Next I

a) 1 1 1

b) 1 2 3

c) 0 0 0

d ) 1 4 9 Answer: A

13) The execution result of the following program is _____.

Dim a(5) As String

Dim b As Integer

Dim I As Integer

For I =0 To 5< /p>

a(I)=I+1

Print a(I)

Next I

a) 123456

< p> b) 6

c) 654321

d) 0 Answer: A

14) The execution result of the following program is _____.

Dim intsum As Integer

Dim I As Integer

intsum=0

For I=20.2 To 5 Step -4.7

intsum=intsum +I

Next I

Print intsum

a) 150

b) 200

p>

c) 50

d) 0 Answer: C

15) The execution result of the following program is _____.

Dim S As Integer,n As Integer

S=0:n=1

Do While n<=100

S =S+n

n=n+1

Loop

Print S

a) 5050

b) 2500

c) 3000

d) 4000 Answer: A

16) The execution result of the following program is _____.

A=100:b=50

If a>b Then

a=a-b

Else

b=b+a

End if

Print a

a) 50

b) 100

c) 200

d) 10 Answer: A

17) The execution result of the following program is ________.

Dim intsum As Integer

Dim I As Integer

intsum=0

For I=0 To 50 Step 10

intsum=intsum+I

Next I

Print intsum

a) 150

b) 200

c) 50

d) 0 Answer: A

18) After the following program is executed, the result of X is _____.

X=0

For I =1 to 5

For j=I to 5

X=X+1

Next j

Next I

Print X

a) 5

b) 10

< p> c) 15

d) 20 Answer: C

19) The result of the execution of the following program is ____.

Private Sub Form_Click()

A$="123":B$="456"

C=Val(A$)+Val(B $)

Print C\100

End Sub

a) 123

b) 3

c ) 5

d) 579 Answer: C

20) The following loop statement will be executed ______ times.

A=100

Do

Print a

a=a+1

Loop until a< =10

a) 1

b) 10

c) 100

d) Infinite loop answer: D

21) After the loop structure of the following program segment is executed, the output value of is _____.

The program segment is:

For I=1 to 10 step 2

y=y+I

Next I

print I;

a) 25

b) 10

c) 11

d) Because the initial value of Y The value is not known, so I am not sure about the answer: C

22) Write the execution result of the program segment ____.

A="abbacddcba"

for I=6 to 2 step -2

x=mid(a,I,I)

< p> y=left(a,I)

z=right(a,I)

z=x & y & z

next I

print Ucase(z)

a) ABA

b) AABAAB

c) BBABBA

d) ABBABA Answer: C

23) The output of the following statement is (in the immediate window) _____.

A="Beijing"

b="ShangHai"

Print a;b

a) Beijing ShangHai

b) Abeijing ShangHai

c) BeijingShangHai

d) Abeijing Answer: C

24) There is the following procedure:

For I=1 To 3

For j=5 To 1 Step-1

Print I+j

Next j,I

The number of times its loop is executed is______.

a) 12

b) 13

c) 14

d) 15 Answer: D

25) There is the following program segment. After the program is executed, the value of variable a is ______.

For I=1 To 2

For J=I To 2

For K=1 To J

a=a+ 2

Next K

Next J

Next I

a) 2

b) 8

p>

c) 10

d) 20 Answer: C

26) After executing the following program, the value of variable a is ____.

Dim I as integer

dim a as integer

a=0

for I=0 to 100 step 2

a=a+1

next I

a) 1

b) 10

c) 51

d) 100 Answer: C

27) After executing the following program, the value of X is ______.

X=3

y=6

Do While y<=6

x=x*y

< p> y=y+1

Loop

a) 3

b) 6

c) 18

< p> d) 20 Answer: C

28) After executing the following program segment, the value of the integer variable c is ___.

A=24

b=328

select case b\10

case 0

c= a*1b

case 1 to 9

c=a*10b

case 10 to 99

c= a*100b

end select

a) 537

b) 2427

c) 24328

d) 240328 Answer: C

29) After executing the following program segment, the loop will be executed ____ times.

For I=1.7 To 5.9 Step 0.9

a=a+1

Print a

Next I

< p> a) 3

b) 4

c) 5

d) 6 Answer: C

30) There are the following statements , the number of loops of this statement after execution is _____.

Dim s,I,j as integer

For I =1 to 3

For j=3 To 1 Step-1

S=I*j

Next j

Next I

a) 9

b) 10

c) 3

d) 4 Answer: A

31) There is the following program, which will ______.

For I=1 to 10 step 0

K=k+2

Next I

a) Form an infinite loop.

b) The loop body is executed and the loop ends.

c) Syntax error.

d) The loop will end if the loop body is not executed. Answer: A

32) There is the following program segment. After the program segment is executed, ***loops________.

For I=1 To 5

For j=1 To I

For k=j To 4

Print "a"

Next k

Next j

Next I

a) 4

b) 5

c) 38

d) 40 Answer: D

33) There is the following program, the running result of this program is ______.

Dim k As Integer

n=5:m=1:k=1

Do While k<=n

m =m*2

k=k+1

Loop

Print m

a) 1

b) 5

c) 32

d) 40 Answer: C

34) The following program outputs the sum of all even numbers between 1 and 1000. Please Complete the program.

Private Sub Command_Click()

Dim x As Double

For I=0 To 1000

If ____ Then

x=x+I

End If

Next I

Print x

End Sub

a) i Mod 2 = 0

b) x Mod 2 = 0

c) I Mod 2 <> 0

d) x Mod 2 < > 0 Answer: A

35) The following is a program for calculating the factorial of 10. Please supplement the program.

Dim t as single

Dim k as Integer

k=0:t=1

While_______

k=k+1

t=t*k

Wend

Print t

a) k<10

b) k>10

c) k=10

d) k>=10 Answer: A

36) _____ is given by A specialized subroutine provided by Visual Basic, which is owned by the object itself and reflects the internal functions or procedures of the object's functionality.

a) File

b) Attribute

c) Method

d) Form Answer: C

37) Just after creating a new standard EXE project, the control that does not appear in the toolbox is _____.

a) Radio button

b) Picture box

c) Common dialog box

d) Text box Answer: C < /p>

38) Which of the following is not a basic data type of Visual Basic is _____.

a) Char

b) String

c) Integer

d) Double Answer: A

39) Among the following operation results, the one with the largest value is ______.

a) 3\4

b) 3/4

c) 4 mod 3

d) 3 mod 4 Answer: D

40) One of the following items that is not a control is _____.

a) Text box

b) Label box

c) List box

d) Message box Answer: D

41) Use the InputBox function to help generate _______.

a) Message box

b) "Save" dialog

c) Simple input box

d) "Color" dialog Box answer: C

42) ______ objects cannot respond to Click events.

a) List box

b) Picture box

c) Form

d) Timer Answer: D

43) The result of 17 mod 3 is _____.

a) 0.5

b) 1

c) 1.5

d) 2 Answer: D

44) Variable X=32769, then it cannot be declared as _____ when declaring the variable.

a) Intrger

b) Variant

c) Long

d) Single Answer: A

45) The value of the expression 2*3^2+2*8/4+3^2 is _____.

a) 64

b) 31

c) 49

d) 22 Answer: B

46) Whether the check object is selected or not is determined by its _____ attribute.

a) Checked

b) Value

c) Enabled

d) Selected Answer: B

47) A control without a Caption property is _____.

a) Label

b) OptionButton

c) Frame

d) LisBox Answer: D

48) Which of the following symbols is a legal variable name in Visual Basic is _____.

a) IF

b) 7AB

c) A[B]7

d) AB_7 Answer: D

49) The statement that causes the form to automatically move downward is Move_____.

a) Left, Top+100

b) Top+100

c) Top+100

d) Top=Top +100 Answer: A

50) The RGB function produces a certain color by mixing the three primary colors of red, green, and blue. Its syntax is RGB (red, green, blue), and the three colors red, green, and blue in parentheses are Use an integer between 0-255 for the base color component. If you use 3 scroll bars to input 3 basic colors respectively, to ensure that the input values ????are valid, you should set the _____ attribute.

a) Max and Min

b) SmallChange and LargeChange

c) Scroll and Change

d) Value Answer: A< /p>