Saturday, May 22, 2010

Visual Basic questions on array and structure?

Could you please help me out with the practice questions.


1. The value stored in an array’s Length property is always ____ the highest subscript in the array.


a. exactly the same as c. one number more than


b. twice d. one number less than











2. You refer to a member variable in an array element using the syntax ____.


a. arrayname(subscript).memberVariable...


b. arrayname(subscript)-%26gt;memberVariabl...


c. arrayname(subscript)[memberVariable...


d. arrayname(subscript)@memberVariable...














3. When referring to a member variable of a structure variable, you use the ____ member access operator to separate the structure variable’s name from the member variable’s name.


a. indirection c. asterisk


b. arrow d. dot











4. In most applications, you enter the Structure statement in the form’s ____ section in the Code Editor window.


a. MainForm c. Declarations


b. Load d. Definitions








5. The members of a structure can be variables, constants, or ____.


a. structures c. procedures


b. classes d. control characters











6. You can create your own data types in Visual Basic using the ____ statement.


a. DataType c. UserDefinedType


b. Structure d. Define











7. When defining a structure, each member variable’s definition contains the keyword ____ followed by the name of the variable, the keyword As, and the variable’s datatype.


a. Dim c. Private


b. Member d. Public

Visual Basic questions on array and structure?
I'm assuming the use of VB.NET





1. c. One number more than, this is because arrays in VB.NET always starts with 0, so the first member is 0, second is 1, etc.





2. a. This is why VB is easy to use, VB doesn't differentiate between functions, variable, property, etc of a class, structure, etc they're all considered members of the function and have the same calling syntax, that is the dot syntax..





3. d. I've explained why in no. 2 question.





4. c. I don't really understand the question, since in VB, the border between declaration section, definition section, etc is just an abstract border, there is no defined border in it.





5. c. Structures can contain classes and other structures (this behavior is called nesting) too, but they aren't considered as members but definition.





6. b. In VB, structure IS User-Defined Data Type. In previous versions of VB the Structure Keyword is Type, which is more obvious that it is a data type.





7. a,c,d. This question is a bit odd, When defining a structure, each member variable's definition contains the Scope Definition followed by the name of the variable, the keyword, As, and the variable's datatype. Scope definition can be , Public, Private, Friend, Protected, Protected Friend, etc while Dim is always implied (Public Dim a as Integer).
Reply:Try here for info





http://www.good-tutorials.com/


http://www.digitaljuice.com/


http://www.tutorialkit.com/


http://www.codestyles.com/


http://www.sitecube.com/website/promo_bw...
Reply:* try this site for some help


http://blogs.msdn.com/vbfaq/


No comments:

Post a Comment