1000 VB.NET MCQ (Multiple Choice Questions) - Sanfoundry
Có thể bạn quan tâm
Here are 1000 MCQs on Visual Basic (Chapterwise).
1. Who developed Visual Basic? a) Symantec b) Ashton-Tate c) Microsoft d) Sybase View AnswerAnswer: c Explanation: Visual Basic is a programming language and environment developed by Microsoft. Visual Basic first version was published in 1991.
2. Which of the following statement is used to define a class in visual basic? a) Event class statement b) Class statement c) Form class statement d) Event statement View AnswerAnswer: b Explanation: The class statement is used to define a class in visual basic. The class statement begins with public class classname clause and ends with End class clause. Within the class statement, you write the code to tell the form and the object how to react to the user’s action.
3. Which of the following extension is used to represent the project file in Visual Basic? a) .vbp b) .vb c) .cls d) .vvb View AnswerAnswer: a Explanation: The .vbp file extension is used to represent the program file in Visual Basic. .cls is used to save the Class module.
4. If you keep a variable undeclared, it is automatically taken as to which of the following data type in Visual Basic? a) Char b) Int c) Object d) String View AnswerAnswer: c Explanation: Visual basic can create variables “on the fly”. This means that if your code contains undeclared variables, Visual basic creates the variable for you and assigns object data type to it. An undeclared variable is a variable, which does not appear in the declaration statement i.e. the Dim statement.
5. Which of the following applications can be developed using Visual Basic tool? a) Graphical User Interface b) Real-time c) Character User Interface d) All of the mentioned View AnswerAnswer: a Explanation: Visual Basic tool provides an easy way to develop graphical user interface (GUI) applications. advertisement
6. In Visual Basic, which of the following is used for coding single-alternative and dual-alternative selection structures? a) Switch-Case block b) If…Then…Else statement c) function overloading d) Recursion View AnswerAnswer: b Explanation: In Visual Basic If…Then…Else statement is used for coding single-alternative and dual-alternative selection structures. The If…Then…Else statement statements provide for a statement block where the condition may be true and another if the condition is false.
7. What will be the output of the following Visual Basic code, If the intnumber variable is 110?
If intnumber<=100 Then Intnumber=intnumber*2; Else Intnumber=intnumber*3; EndIfa) 180 b) 330 c) 156 d) 270 View AnswerAnswer: b Explanation: Since the intnumber is 110, i.e. it is greater than 100, thus else part of the code will be executed, i.e., the if part of the code will not be executed. Thus intnumber=intnumber*3 will be executed, thus 110*3=330 will be stored in intnumber.
8. In the Visual Basic application, which of the following are listed in a properties window? a) Items b) Values c) Attributes d) Objects View AnswerAnswer: c Explanation: Attributes also known as properties are listed in a Properties Window. Attributes are keyword-like tags in which you can specify additional information about entities defined in Visual Basic application. Attributes are saved as assembly’s metadata.
9. What will be the output of the following Visual Basic expression?
Financial.Pmt (0.05, 3, 9000)a) -3043.88 b) -3034.88 c) -3408.48 d) -3304.88 View AnswerAnswer: d Explanation: The above expression calculates for a loan of Rs. 9000 for 3 years at 5% interest. Rate is 0.05, Nper is 3 and PV is 9000. The annual payment rounded off to nearest is, -3304.88.
10. Which of the following is commonly used to perform an immediate action when clicked in Visual Studio? a) Button control b) Close c) End d) Exit View AnswerAnswer: a Explanation: Every application should give the user a way to exit the program. Most Windows Application accomplishes this task using the Exit option. In visual basic a button is used for sending an application. It is commonly used to perform immediate action when clicked. advertisement
11. In the following Visual Basic code, what will be in msg, if str contains “visual basic”?
Dim str as String Dim msg as String If str.toUpper=”VISUAL BASIC” msg=”VB.Net” Else msg=”Not Visual Basic” EndIfa) Bye b) Hi c) Logical Error d) Compiler Error View AnswerAnswer: b Explanation: str contains “visual basic”. When we do str.toUpper, the string in str is changed to “VISUAL BASIC”. Thus, the comparison satisfies, and the if statement is executed, since the comparison returns a true value. Thus msg will contain “VB.Net”.
12. Which of the following displays the list of projects contained in the Visual Basic current solution? a) List Window b) Project Window c) Catalogue Window d) Solution Explorer Window View AnswerAnswer: d Explanation: The Solution Explorer Window provides you with an organized view of your projects and their files as well as ready access to the commands that pertain to them. A toolbar associated with this window offers commonly used commands for the item you highlight in this list.
13. Which of the following method is used to sort an array in visual basic? a) Array.Sort() b) Array.sortAscending() c) Array.arrayArrange() d) Array.arrange() View AnswerAnswer: a Explanation: You can use the Array.Sort method to sort a one-dimensional array’s values in ascending order. To sort the values in descending order, you first use the Array.Sort method to sort the values in ascending order, and then use the Array.Reverse method to reverse the values. The syntax is as follows, where the arrayName is the name of the array: Array.Sort(arrayName)
14. Which of the following is the caption part for the following Visual Basic command?
MessageBox.Show("Delete Visual Basic?","VB.Net",MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2).a) MessageBoxButtons.YesNo b) MessageBoxIcon.Exclamation c) “VB.Net” d) “Delete Visual Basic?” View AnswerAnswer: c Explanation: The syntax of the MessageBox.Show is-
MessageBox.Show (text, caption, buttons, icon, [defaultButton])The caption is given as the second component in the syntax. In the above statement, the second component is the “VB.Net”, thus it is the caption.
Từ khóa » Visual Basic Dot Net Mcq Pdf
-
Visual Basic .NET MCQ Question With Answer | PDF Download | 2022
-
MCQ Of Visual Basic Dot Net (VB.Net) With Answer Set-2 - Gfgg
-
Visual Basic .NET MCQ Questions And Answers - JobsCaptain
-
Visual Basic (VB) MCQ Questions And Answers | Gkseries | Page-2
-
VB Net Multiple Choice Questions And Answers PDF - Scribd
-
Programming With Visual Basic Net Mcq Pdf
-
[PDF] B.Sc_.-Computer-Science_SF_16UCS517-DOT-NET-Programming ...
-
100+ VB NET MCQ | Visual Basic Multiple-Choice Questions
-
.NET Programming Solved MCQ's With PDF Download [set-2]
-
VB.Net Online Quiz - Tutorialspoint
-
Visual Basic MCQs With Answers Pdf Sample Papers Download
-
VB.Net Part – 1 (in English)
-
Programming In Visual Basic Solved MCQ's With PDF Download [set-5]
-
VB.NET MCQ Questions With Answers ~ Garbage Collection.pdf