Department of Computer Science & Technology 4 Semester...

14
Department of Computer Science & Technology 4 th Semester Course Code & Name: 060010401, GUI Programming 2014 1 Mr. Dhirendra N. Tandel Unit 1. Introduction to .NET Framework Short Questions 1. What is .NET Framework? 2. What is VB.NET? 3. Which are the main components of .NET Framework? 4. What is CLR? 5. Which are the two components of CLR? 6. What makes CLR provide cross language feature? 7. What is MSIL? 8. What do you mean by managed code? 9. Is CLR is capable of handling unmanaged code? 10. List out the features of CLR. 11. What do you understand by memory management and garbage collection? Are they same? 12. Is it possible to run garbage collection explicitly? How? 13 What is the main purpose of Garbage collector? 14. What is the function of JIT compiler? 15. List at least three advantage of .NET Framework. 16. Is code written in Java can be executed under .NET Framework? 17. List at least five languages which are supported in .NET Framework? 18. What is an Assembly? 19. What is Difference between Namespace and Assembly? 20 What are the advantages of an assembly? 21 What is Code Access Security? 22. What is Metadata? 23. What is Difference between Namespace and Assembly? 24. What is Common Type System? 25. What is Common Language Specification? 26. What is the difference between an EXE and a DLL? 27. What is Namespace? 28. What is difference between MetaData and Manifest? 29. State the differences between the Dispose() and Finalize(). 30. Which is the root namespace for fundamental types in .NET Framework? 31. What is the top .NET class that everything is derived from? 32. What is Class Library? Long Questions 1. Explain the types of projects that can be created using Visual Studio 2010. 2. What is CLR? Which are the two Framework services that define the rule for .NET languages? Also list at least four features of CLR. 3. Inter language operation is possible in .NET Framework. Justify your answer. 4. What is .NET Framework? List and explain the constituent parts of .NET Framework with necessary diagram. 5. List and explain at least five advantages of .Net Framework. 6. Differentiate between managed and unmanaged code. 7. Write a brief note on Visual Studio Integrated Development Environment. 8. How the .Net Framework compiles and executes the program? Also discuss the role of an operating system in execution. 9. What is garbage collection? Is garbage collection always runs automatically or it can be run by force? Justify your answer with example. 10. Write a detail note on common language runtime. 11. Differentiate between Java Virtual Machine and .NET Framework. 12. Briefly describe how Common Type System made interfacing possible between programs written in multiple languages. 13. Visual Studio IDE increases the developer productivity. Justify your answer. 14. Explain the functionalities of common language specification. 15. Discuss on Class Library’s unified and extensible features. Give appropriate example. Multiple Choice Question 1. Which of the following is not a .NET compliant language? a) Visual Basic b) Visual C# c) Java d) Visual F#

Transcript of Department of Computer Science & Technology 4 Semester...

Page 1: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

1 Mr. Dhirendra N. Tandel

Unit 1. Introduction to .NET FrameworkShort Questions1. What is .NET Framework?2. What is VB.NET?3. Which are the main components of .NET Framework?4. What is CLR?5. Which are the two components of CLR?6. What makes CLR provide cross language feature?7. What is MSIL?8. What do you mean by managed code?9. Is CLR is capable of handling unmanaged code?10. List out the features of CLR.11. What do you understand by memory management and garbage collection? Are they same?12. Is it possible to run garbage collection explicitly? How?13 What is the main purpose of Garbage collector?14. What is the function of JIT compiler?15. List at least three advantage of .NET Framework.16. Is code written in Java can be executed under .NET Framework?17. List at least five languages which are supported in .NET Framework?18. What is an Assembly?19. What is Difference between Namespace and Assembly?20 What are the advantages of an assembly?21 What is Code Access Security?22. What is Metadata?23. What is Difference between Namespace and Assembly?24. What is Common Type System?25. What is Common Language Specification?26. What is the difference between an EXE and a DLL?27. What is Namespace?28. What is difference between MetaData and Manifest?29. State the differences between the Dispose() and Finalize().30. Which is the root namespace for fundamental types in .NET Framework?31. What is the top .NET class that everything is derived from?32. What is Class Library?Long Questions1. Explain the types of projects that can be created using Visual Studio 2010.2. What is CLR? Which are the two Framework services that define the rule for .NET languages? Also list at least four

features of CLR.3. Inter language operation is possible in .NET Framework. Justify your answer.4. What is .NET Framework? List and explain the constituent parts of .NET Framework with necessary diagram.5. List and explain at least five advantages of .Net Framework.6. Differentiate between managed and unmanaged code.7. Write a brief note on Visual Studio Integrated Development Environment.8. How the .Net Framework compiles and executes the program? Also discuss the role of an operating system in

execution.9. What is garbage collection? Is garbage collection always runs automatically or it can be run by force? Justify your

answer with example.10. Write a detail note on common language runtime.11. Differentiate between Java Virtual Machine and .NET Framework.12. Briefly describe how Common Type System made interfacing possible between programs written in multiple

languages.13. Visual Studio IDE increases the developer productivity. Justify your answer.14. Explain the functionalities of common language specification.15. Discuss on Class Library’s unified and extensible features. Give appropriate example.Multiple Choice Question1. Which of the following is not a .NET compliant language?

a) Visual Basicb) Visual C#c) Javad) Visual F#

Page 2: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

2 Mr. Dhirendra N. Tandel

2. Which types of application can be created using .NET Framework?a) ASP.NET Web Applicationb) Web Servicesc) Windows Forms Controlsd) All of above

3. A ____________________ organize classes into a hierarchical structure of related groups.a) class librariesb) namespacec) common type systemd) common language runtime

4. The _____________ perform memory management, garbage collection and exception handling.a) CLRb) MSILc) CTSd) CLS

5. Which of the following is responsible for multilingual support of .Net?a) Base class librariesb) Common Language Specificationc) Garbage Collectiond) Just In Time Compiler

6. Common language specification(CLS)a) is an execution engine for all .NET application.b) is similar to JVM as in Java.c) defines standard rules for defining .Net compliant languages.d) is a language compiler.

7. Which of the following statement is not correct?a) CLR is an execution engine of .NET Framework.b) Assembly is a logical unit of deployment.c) CLR executes manage code.d) Net provides cross language interoperability using code access security.

8. Which of the following is not true for garbage collection?a) It manages the reclamation of unused memoryb) It deals with circular referencesc) You can be certain when an object will be reclaimed by garbage collectord) It disposes unreferenced objects

9. When does Garbage collector run?a) After every one minuteb) When application is running low on memoryc) It runs randomlyd) When system is doing no activity.

10. How many levels of compilation happen in .NET Framework?a) Oneb) Twoc) Threed) Four

11. Which of the following is true for the managed code?a) Code which runs under certain rules provided by CLRb) Code which is not managed by CLR.c) Code which is written in non .NET compliant language.d) Code which cannot be run by CLR.

12. Which component of .NET Framework converts the MSIL code to native code as needed?

Page 3: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

3 Mr. Dhirendra N. Tandel

a) CLSb) CTSc) JITd) Operating System

13. Which of the following is responsible for providing unified programming model?a) CLSb) CTSc) JITd) Visual Studio IDE

14. What is true for namespace in .NET Framework?a) Namespace is a logically group types.b) An assembly can contain any number of Namespace.c) Same namespace can exist in different assemblies.d) All of the above

15. What is false for CLR in .NET Framework?a) Manage codeb) Database connectivityc) Memory managementd) Cross language integratione) None of above

Fill in the Blanks1. Every data type supported by Common Type System is derived from _____________.2. CIL stands for ___________________.3. Reference type is converted into value type is called ____________________.4. __________ is the root in .Net namespace.5. __________ is the heart of .NET Framework.6. ____________of compilation happens in .NET Framework.7. Assembly store in a file is called ____________.8. CTS data types are ________ and ____________.9. Value type is stored in __________.10. Reference type is stored in _____________.11. The .Net program is compiled in to special type of code called ___________________.12. This MSIL is turned into executable code using _____________ compiler.13. Its function is to reclaim the memory when the object is no longer in use is known as ___________.14. Managed code consists of ___________ and ________________.15. When code is executed ____________ is used to discover information about your classes, members, inheritance and

so on.16. The actual .Net code can be executed by _______________.17. __________ contains information about the assembly and the resources.True/False1. Code written in any .NET complaint language can be run using .NET Framework.2. .Net Framework supports many languages.3. MSIL is not a CPU independent code.4. CLR is a runtime environment of the .Net Framework.5. It is possible to run code written in any programming language through .NET Framework.6. JIT compiler converts the source code into native code.7. .Net Framework is an operating system.8. Source code written in any language is directly converted into native code in .Net Framework.9. .Net Framework does not support web application development.10. Application developed using .NET Framework is said to be platform independent.11. The code written in languages that conforms to the common language specification can be executed by .Net

Framework.12. .Net Framework is language.13. Code written in JAVA can be run using .NET Frameowrk.14. CLR converts the MSIL to native language.15. Garbage collection is a function of CLR.16. CLR is a language independent runtime environment.

Page 4: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

4 Mr. Dhirendra N. Tandel

17. .Net Framework supports cross language inheritance.18. The same MSIL code can be executed on different operating system without rewrite the source code.19. JIT compiler is a part of the runtime execution environment.20. Any project that compiles to an EXE or DLL files produces an assembly in .NET.21. CTS provide base set of Data Types which is responsible for cross language integration.22. JIT call native code for execution just before when each function is called.23. Once the destructor call then we can control them.24. J# is supported by .NET framework.25. Garbage collector runs randomly in VB.NET.26. .NET Framework provides different programming models for Windows-based applications and Web

based applications.27. Garbage collector freeing memory occupied by unreferenced objects.

Unit 2. Introduction to Visual Basic ProgrammingShort Questions1. What is the difference between System.String and System.StringBuilder classes?2. What is the index value of the first element in an array?3. Is it a good practice to handle exceptions in code?4. Do events have return type?5. Can users define their own exceptions in code?6. Is it possible to execute two catch blocks?7. Define an event.8. Define variable and constant.9. What is a data type? How many types of data types are there in .NET?10. Which statement is used to replace multiple if-else statements in code?11. What is the difference between constants and read-only variables that are used in programs?12. What is an identifier?13. What does a break statement do in the switch statement?14. Is it necessary to declare variable in Visual Basic before using it?15. Can we change the size of array variable during runtime?16. How can you keep the previous values of an array as it is when re-declare an array variable using ReDim?17. What is an Integer division operator?18. What is the storage size of string type variable?19. Can you change data type of an array variable at run time using ReDim statement?20. What are the two miscellaneous operators?21. Is “Is” an operator in Visual Basic?21. List the two concatenation operators.22. Which operator is used to get the reminder as a result of division?23. What is the difference between “/” and “\” operator?Long Questions1. What is the function of the Try-Catch-Finally block?2. Differentiate between Boxing and Unboxing.3. What is data type? How many types of data types are there in .NET? Discuss on at least three in detail.4. Mention the two major categories that distinctly classify the variables of VB.NET programs.5. Explain the difference between implicit and explicit type conversion using appropriate examples.6. Explain the role of Option statement with example.7. Write a program which demonstrates function calling itself.8. Discuss on the types exception handling techniques in Visual Basic. Also discuss which technique is appropriate and

why?9. List at least five string functions. Explain any three with example.10. What is the use of For Each loop? Explain with example.11. Write a menu drive program which sorts an array of N elements depending on the type of sort selected from menu

and also display the number comparison for that sort. [You can use Bubble sort, Quick sort, Selection sort, Insertionsort]

12. Differentiate between Do While and Do Until loop using example.13. What will be the error/output of following loop?[Consider the other required code is written]

For count as Integer=0 To 10 Step -1Console.WriteLine(count)Next count

14. What do you mean by a scope of a variable? List out all possible scope and also explain them with example.

Page 5: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

5 Mr. Dhirendra N. Tandel

15. What is the significance of Sub Main() procedure? Can a module have more than one Sub Main() procedure? Can aproject have more than one Sub Main() procedure?

16. Write a procedure that take an age as an input and display “<60” if age less than 60 or display “>60 <80” if age isgreater than 60 and less than 80 and display “>80” if age is greater than 80. [Do not make use of If Else Statement]

17. What is the scope of a variable procedure_Scope in the following code snippet?[Assume that other required code iswritten]Dim block_Scope as Integer=0For procedure_Scope as Integer= block_Scope To 10Console.WriteLine(“My Scope is not Module Scope”)Next procedure_Scope

18 What is StringBuilder class? How it differs from String class? Explain using example.19 What will be the output of following code if Option Compare is set to Text?[Note: Consider code is having no error]

Dim chr1 as Char=”A”, chr2 as Char=”a”If chr1 = chr2 Then

Console.WriteLine(“A = a”)Else

Console.WriteLine(“A # a”)End If

20 What will be the output of the following code snippet?Sub Main()

For count as Integer=10 To 0Console.WriteLine(count)

Next countConsole.WriteLine(“Total 10 Values get displayed”)

End Sub21 What will be the error/output of the following code snippet?

Module Module1Sub Main()

For count as Integer=0 To 10Console.WriteLine(count)If count=0 Then

Exit ForEnd If

Next countEnd SubEnd Module

22 What will be the output of the following code snippet?Sub Main()

For count as Integer=0 To 10Console.WriteLine(count)count = count + 1

Next countConsole.WriteLine(“Even Numbers”)

End Sub23 What will be the value of variable count after count = count + 1 statement get executed in loop once?

Sub Main()For count as Integer=0 To 10

Console.WriteLine(count)count = count + 1

Next countConsole.WriteLine(“Even Numbers”)

End Sub24 What will be the output of the following code snippet?

Sub Main()Dim arr(3) as IntegerFor count as Integer=0 To 3

arr(count) = countNext countReDim arr(4)

Page 6: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

6 Mr. Dhirendra N. Tandel

For count as Integer=0 To 4Console.WriteLine(arr(count))

Next countEnd Sub

Multiple Choice Question1. The Do While loop iterates until the condition results in _____.

a) Trueb) Falsec) Either True or Falsed) None of These

2. The __________ used to loop over elements in an array or Visual Basic collection.a) For...Next loopb) Do...Loop loopc) While...End While loopd) For Each...Next loop

3. Which of the following is true?a) Boxing is an implicit conversion and Unboxing is an explicit conversionb) Boxing and Unboxing is an implicit conversionc) Boxing is explicit and Unboxing is an implicit conversiond) Boxing and Unboxing is an explicit conversion

4. Option Strict statementa) Forces explicit declaration of all variables in a file.b) Restricts implicit data type conversions to only widening conversions.c) Restricts implicit data type conversions to only narrowing conversions.d) Declares the default comparison method to use when comparing string data.

5. Option Explicit statementa) Forces explicit declaration of all variables in a file.b) Restricts implicit data type conversions to only widening conversions.c) Restricts implicit data type conversions to only narrowing conversions.d) Declares the default comparison method to use when comparing string data.

6. Option Compare statementa) Forces explicit declaration of all variables in a file.b) Restricts implicit data type conversions to only widening conversions.c) Restricts implicit data type conversions to only narrowing conversions.d) Declares the default comparison method to use when comparing string data.

7. ReDim statement isa) Used at procedure level to reallocate storage space for dynamic array variables.b) Used at procedure level to reset storage space for dynamic array variables.c) Used at procedure level to allocate storage space for array variables.d) Used at procedure level to reset data type for dynamic array variables.

8. Which of the following is true?a) Unboxing is an implicit conversion of a value type to the type objectb) Unboxing is an explicit conversion of a value type to the type objectc) Unboxing is an implicit conversion of an object type to the type valued) Unboxing is an explicit conversion of an object type to the type value

9. Which of the following is true?a) Boxing is an implicit conversion of a value type to the type objectb) Boxing is an explicit conversion of a value type to the type objectc) Boxing is an implicit conversion of an object type to the type valued) Boxing is an explicit conversion of an object type to the type value

10. If Module is having name Module1, then what will be the end statement?a) End Module

Page 7: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

7 Mr. Dhirendra N. Tandel

b) End Module1c) End Modulesd) None of above

11. What is the storage size of Object data type?a) 2 Bytesb) 8 Bytesc) 32 Bitsd) 8 Bits

12. Which of the following is true for the following statement?Dim days(6) As String = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}

a) You cannot store more than six values because size if six.b) You cannot initialise array variable at a time of declaration.c) Explicit initialization is not permitted for arrays declared with explicit bounds.a) The ArrayIndexOutOfRangeException will be raised.

13. The TypeOf is a/an _________________.a) Methodb) Objectc) Classd) Operator

14. Which of the following must be on the first line of your file, module or class if need to be included?a) Imports statementb) Option Statementc) Declarationd) Module name

15. The Do Until loop iterates until the condition results in _____.a) Trueb) Falsec) Either True or Falsed) None of these

16. Which tool of Visual Basic .NET offers a quick look at the files associated with a given solution?a) Solution Explorerb) Properties Windowc) ToolBox Windowd) Server Explorer

17. Which of the following are optional in Try...Catch...End Try statement?a) Catch Block Onlyb) Catch and Finally Block Bothc) Either Catch or Finally Blockd) None of these

Fill in the Blanks1. The __________________ block of Try...Catch..End Try get executed every time.2. The lower limit and upper limit of Byte type variable is __________ & ____________ respectively.3. If you try to divide 10 with zero using forward slash (/) operator then it will generate

____________________________exception.4. The ___________________ is a base class of all other exception classes.5. The ______ & ________ are the two string concatenation operators.6. If you try to divide 10 with zero using forward slash (\) operator then it will generate

____________________________exception.7. The ________________ block contains the statements that may raise runtime error.8. The ________ operator is used for integer division and _________ operator is used for division.9. The ___________ block is optional block in Try..Catch...End Try statement.10. The _________________ is ultimate base class of all classes in the .NET Framework.

Page 8: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

8 Mr. Dhirendra N. Tandel

11. When you declare a variable within a procedure it scope is called _______________________.12. The _________________ keyword is used to maintain the data in an existing array when you change the size of the

last dimension.13. If the variable is declared within a loop then its scope is said to be a _______________ scope.14. The Option Strict is by default __________.15. The storage size of Char type variable is ________ bytes.True/False1. Conversion of an object type to the type value is implicit.2. Object data type object can hold any kind of value.3. Option Strict is by default On.4. Is it compulsory to write increment statement within For loop?5. Select Case statements can be nested.6. Option Explicit is by default Off.7. An array with declaration Dim five(5) as Integer can hold five integer values.8. You can use multiple expressions or ranges in each Case clause of Select case statement. [e.g. Case 1 To 4, 7 To 9, 11,

13, Is > MaxNumber][MaxNumber is a variable]9. Conversion of a value type to the type Object is explicit.10. You can specify ranges and multiple expressions for character strings in Case clause of Select Case statement. [e.g.

Case "everything", "nuts" To "soup", TestItem] [TestItem is a variable]11. We cannot change the by default settings of Visual Studio IDE.12. It is compulsory to increment or decrement counter within While loop when the loop depends on that counter

values to terminate a loop.13. Option Compare is by default set to Text.14. The & operator is used to concatenate to strings type values only, you can not concatenate string and numeric type

values using it.15. The Do Until loop iterates till the condition supplied evaluates to False.16. If the argument to the procedure or function is optional then you have to provide default value for that argument.

Unit 3. GUI Design and Event Driven ProgrammingShort Questions1. How can we auto size a button to fit its text?2. How can we display an icon or a bitmap image on the Button control?3. Which method is used to generate the click event of the Control class for the Button control in Visual Basic?4. How can you display a default value in the text box of an input box?5. What is the function of the CheckState property of the CheckBox control?6. Write a code to select an item in the ListView control programmatically in Visual Basic?7. Which method provides the functionality to display a dialog box at runtime?8. Which event of a TextBox control helps in restricting a text box from accepting numeric digits in .NET 4.0?9. What is the difference between the Add() and Insert() methods of a ListBox control?10. Consider a situation where you have added panels in a StatusBar control; however, they are not displayed at run

time. What could be the reason for this?11. What is the function of the SizeMode property of the PictureBox control?12. How can you prevent users of an application from editing the text in the ComboBox controls in .NET 4.0?13. How do we format numbers, dates, and currencies in a text box?14. Is it possible to add an image on the RadioButton control?15. Name the methods, available in .NET 4.0, that are used to add and delete items from a ListBox control?16. What is the importance of a Button control?17. What is die difference between a CheckBox control and a RadioButton control?18. What are the three states set in the CheckState property of CheckBox?19. Can you add more than one item simultaneously in the ListBox control?20. Is it possible to enter more than one line in a TextBox control?21. How can you enable a text box to change its characters format, so that users can enter password?22. What is the difference between a ListBox control and a ComboBox control?23. Name the parent class for all Windows controls.24. What is the MaskedTextBox control? What does the Mask property do?25. How can you adjust the height of a combo box drop-down list?26. How can you enforce a text box to display characters in uppercase?27. How can you move and resize a control on a Windows form?28. What is use of the DropDownStyle property of the ComboBox control?Long Questions1. How does an MDI form differ from a standard form?2. What is StartPosition of Form control? Explain it in brief.

Page 9: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

9 Mr. Dhirendra N. Tandel

3. Explain the Windows Forms with at least five properties other than common properties.4. Explain the Selection properties of TextBox using example.5. Explain the KeyPreview property of Form with examples.6. Differentiate LinkLabel and Label controls.7. Explain ListBox and ComboBox controls with its properties and methods.8. Explain SelectedItems collection of ListBox control.9. Explain Multiline and WordWrap property of TextBox control.10. Explain InputBox and MSgBox with syntax and examples.11. What is procedure? How it differ from function? How do we pass arguments in it? Explain with example.12. Briefly describe the Items collection of ComboBox control and ListBox Control.13. Discuss on form events.14. Explain keyboard events with suitable example.15. Explain mouse event with suitable example.16. How events of control added during run time.17. Explain the use of following controls.

MaskedTextbox, ComboBox, ListBox, CheckBox, RadioButton18. Explain scrollbar control with its properties and methods and events.19. Write about ImageList control and properties.20. Write a code to populate ListBox control.21. Write note on TreeView control.22. Write about Timer control.23. Explain the use of MenuStrip control and context MenuStrip control? How do you create a separator bar? How do

you add image to menu items.24. Short note on ToolStrip. How to add button in the ToolStrip during runtime?25. Discuss on MDI Form.Multiple Choice Question1. The location of the form on the desktop during execution is determined by the:

a) Form Designer windowb) Project Explorer windowc) Context Menud) Form Layout window

2. Setting the SelectedIndex property of a ListBox to -1 will cause_______________________.a) cause an error.b) cannot be done.c) de-select any selected item.d) Both a and b.

3. Which is not a valid value for the ListBox SectionMode Property?a) Noneb) Onec) MultiSimpled) MultiExtendede) All of the above.

4. Which is not a common control event?a) Clickb) SingleClickc) DoubleClickd) MouseMovee) MouseDown

5. In event-driven programming an event is generated by:a) the system.b) a user’s action.c) the program itself.d) Both a and b.e) All of the above.

6. A click event procedure stud for the label control can be created by:a) Selecting the object and event from the code editor window’s drop-down boxes.b) Typing the code in the code editor window.c) By double clicking the control.d) Both a and b.e) All of the above.

7. The Button control can be activated:

Page 10: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

10 Mr. Dhirendra N. Tandel

a) programmatically through the click event.b) by clicking the button with the mouse.c) with the form’s DefaultButton property.d) Both a and b.e) All of the above.

8. Which is not a property of the Common control class?a) Showb) BackColorc) Fontd) ForeColore) Name

9. If you were assigned to develop an ordering system for cars, and you needed to develop a form in which users canselect which options they would like to have included in their car, which control would be most appropriate to use?

a) CheckBox Groupb) RadioButton Groupc) TextBoxd) Button

10. Visual Basic .NET's ______ ______ statement can handle conditions with multiple outcomes, as opposed to theIf...Then...Else statement, which can trigger only two possible outcomes.

a) Select Caseb) If Thenc) Select Optiond) Branch If

11. Which property can be read from both RadioButtons and CheckBoxes at run-time to determine which control isselected?

a) Checkedb) CheckStatec) Both a and bd) None of the above

12. Suppose you are designing an application for admissions to a college or university, and you need to decide how toprovide the user with a selection of racial backgrounds. Which control would be most appropriate, assuming no extraevent handlers are written?

a) CheckBox Groupb) RadioButton Groupc) TextBoxd) Label

13. What is tool tip text?a) Tool tip text is a tip of the dayb) Tool tip text does not existc) Tool tip text is shown when the mouse is held over a object for a period of timed) Tool tip text is the same as the caption

14. How many types of message boxes are there in VB?a) 5b) 6c) 7d) 8

15. Message boxes are used fora) when you want to ask the user a questionb) display an error messagec) advise the userd) All the above

16. On start up, which of this window is not displayed?a) The Blank Form windowb) The Class windowc) The Project windowd) The Properties window

17. Which are the standard prefixes for the Button and Combo box controls respectively in .NET?a) btn and chbb) btn and cboc) bto and chbd) cmd and cbo

Page 11: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

11 Mr. Dhirendra N. Tandel

Fill in the Blanks1. ________________number of RadioButton in a GroupBox can be selected at the same time?2. _________________property determines whether a control is displayed to the user.3. ______________ standard prefix for the name of a RadioButton control.4. Active is a property of _____________ control.5. The CancelButton property belongs to ____________ object control.6. ________________property is used to hide the control.7. __________________ method of a ListBox control will remove just one item at a time.8. The Tick event is found only in _______________ object control.9. ________________ property is used to get selected value from radio button.10. ____________________ event is activated when a RadioButton is selected.11. ________________property is used to make the form visible or invisible in Taskbar.12. The _______________ property is used to skip the focus on control when moving through TAB key.13. The ___________________ class is used in KeyPress event of TextBox control to handle the pressed key.14. The _______________ event is fired before the Activated event of Form control.15. The ___________________ class is used in KeyDown event of TextBox control to handle the pressed key.True/False1. The Minimum property of VScrollBar control can be negative number as well.2. If none of the conditions of a Select Case statement are met, then whatever code is specified in the Case Else section

will run as a last resort.3. If... statements cannot be nested whatsoever due the complexity of this programming challenge.4. The Exit Sub statement can be used prematurely end a subroutine, preventing any unnecessary processing from

running.5. The default value of Maximum property in TrackBar control is 100.6. We cannot load image into PictureBox control at runtime.7. T he default value of Maximum property in HScrollBar control is 10.8. Nested If statements cannot be used to determine an outcome if the conditions used in the statement are not

related to each other.9. A Select Case statement differs from an If...Then...Else statement in the fact that its test condition may be any

numeric or string value, whereas the If...Then...Else statement strictly requires a numeric condition.10. Locked property can be set or get during runtime.11. Name property of one control can be same as other control on same Form.12. It is possible to select multiple values from ComboBox control while running.13. If the ReadOnly property of TextBox control is set to True at design time it cannot be changed during runtime.14. ToolTip is a property of control in VB.Net.15. You cannot set the Font property of control during runtime.

Unit 4. Object Oriented Programming in Visual BasicShort Questions1. What are the difference between Structure and Class?2. What are class access modifiers?3. What is the difference between early binding and late binding?4. What is the difference between a Thread and a Process?5. How a base class method is hidden?6. What is an Interface?7. How is method overriding different from method overloading?8. What is the relationship between a class and an object?9. What is the difference between arrays and collection?10. How can you prevent your class to be inherited further?11. Can you specify the accessibility modifier for methods inside the interface?12. Is it possible for a class to inherit the constructor of its base class?13. Can you declare an overridden method to be static if the original method is not static?14. Why is the virtual keyword used in code?15. Can you allow a class to be inherited, but prevent a method from being overridden in C#?16. Can you inherit private members of a class?17. Does .NET support multiple inheritance?18. In which namespace, all .NET collection classes are contained?19. What is an ArrayList?20. Can you use the 'throws' clause to raise an exception?21. What do you mean by data encapsulation?22. What is the difference between procedural and object-oriented programming?23. Can you declare a private class in a namespace?

Page 12: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

12 Mr. Dhirendra N. Tandel

24. A structure in Visual Basic can implement one or more interfaces. Is it true or false?25. What is a static constructor?26. When do you really need to create an abstract class?27. Can you write a class without specifying a namespace? Which namespace does it belong to by default?Long Questions1. Explain the basic features of OOPs.2. What is the difference and similarities between a class and a structure?3. Explain the concept of constructor and destructor?4. State the features of an interface.5. How can you prevent a class from overriding in Visual Basic?6. What are abstract classes? What are the distinct characteristics of an abstract class?7. Explain different types of inheritance.8. You have defined a destructor in a class that you have developed by using the Visual Basic programming language,

but the destructor never executed. Why did the destructor not execute?9. What are the different ways a method can be overloaded?10. Differentiate between an abstract class and an interface.11. Write short note on object oriented programming.12. Write a detail note on creating properties event in a class.13. Discuss on class modifiers. How to define a class?14. Write about access modifiers used in class declaration.15. How to create abstract class? Compare it with simple class.16. Distinguish call by reference and call by value.17. How interfaced-based polymorphism implements? Explain with example.18. Discuss inheritance as a feature of OOP with suitable example.19. Write short note on inheritance.20. How abstract class differs from interface?21. What is an Interface? Explain it with appropriate examples.22. Write on interface. Explain interfaced polymorphism.23. Define class and also show how to create class. How constructor and destructor are created for a class and how they

will be called.Multiple Choice Question1. An object is composed of:

a) Propertiesb) Methodsc) Eventsd) Both a and be) All of the above

2. Which statement about objects is true?a) One object is used to create one classb) One class is used to create one objectc) One object can create many classesd) One class can create many objectse) There is no relationship between objects and classes

3. Which feature is needed to make a programming language object oriented?a) Encapsulationb) Inheritancec) Polymorphismd) Both a and be) All of the above

4. We should think of the practice of object-oriented programming as:a) a simple answer to the complex problem of creating software.b) an incremental improvement to the problem of creating software.c) the way to get rid of a werewolf.d) Both a and b

All of the above5. Encapsulation makes it easier to:

a) reuse and modify existing modules of code.b) write and read code by sharing method names.c) hide and protect data from external code.d) Both a and be) All of the above

Page 13: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

13 Mr. Dhirendra N. Tandel

6. Inheritance makes it easier to:a) reuse and modify existing modules of code.b) write and read code by sharing method names.c) hide and protect data from external code.d) Both a and be) All of the above

7. Polymorphism makes it easier to:a) reuse and modify existing modules of code.b) write and read code by sharing method names.c) hide and protect data from external code.d) Both a and be) All of the above

8. When using encapsulation how should data be shared with external code?a) Eventsb) Methodsc) Propertiesd) Private variablese) Public variables

9. Which statement is true?a) A base class inherits some of the properties of a derived class.b) A base class inherits all of the properties of a derived class.c) A derived class inherits some of the properties of a base class.d) A derived class inherits all of the properties of a base class.e) None of the above

10. When a base class is changed:a) there is no effect on the derived class.b) the derived class changes when the key word Overridden is used.c) only the methods of the derived class change.d) only the properties of the derived class change.e) the derived class automatically changes.

11. Polymorphism can apply to:a) math operators.b) method names.c) object names.d) Both a and b.e) All of the above

12. With polymorphism:a) one method can have multiple names.b) one object can have multiple names.c) many methods can share the same name.d) many objects can share the same name.e) None of the above statements are true.

13. Which element of a class is optional?a) Constructsb) Fieldsc) Methodsd) Propertiese) All of the above

14. What is the suggested order for the definition of class elements from first to last?a) Constructs, fields, methods, propertiesb) Properties, constructs, fields, methodsc) Fields, properties, constructs, methodsd) Constructs, properties, fields, methodse) Methods, constructs, properties, fields

15. The standard for designing a field is that it be defined as a:a) private method.b) public method.c) private variable.d) public variable.e) None of the above

16. Which statement will call a constructor of a base class?

Page 14: Department of Computer Science & Technology 4 Semester 2014utu.ac.in/dcst/download/documents/QBMSCIT060010401.pdf · 2014-02-21 · Department of Computer Science & Technology 4th

Department of Computer Science & Technology 4th SemesterCourse Code & Name: 060010401, GUI Programming

2014

14 Mr. Dhirendra N. Tandel

a) Base.New( )b) BaseConstructor.New ( )c) CallBase.New( )d) Constructor.New ( )e) MyBase.New( )

17. Which is true for constructors in a class?a) All constructors must have the same number of parameters.b) All constructors must be the same parameter data type.c) Some constructors can have the same list of parameters.d) Only two constructors in a class can have the same list of parameters.e) No two constructors in a class can have the same list of parameters.

18. A constructor is a special type of:a) class.b) field.c) method.d) property.e) variable.

Fill in the Blanks1. The ________________binds the data and the functions into a single entity called object.2. The _____________________means hiding of a data.3. Interfaces have only ______________ methods in their class.4. A _______________ statement will call a constructor of a base class.5. To create abstract class _________ keyword is used.6. _______________keyword is used to inherit class from parent class.7. A ___________ keyword prevents a class being used as a base class.8. A _______________ keyword indicates that the class is intended for use as a base class only.9. A _____________ keyword allows a property or method in a class to be overridden.10. A ______________ keyword prevents a property or method from being overridden.11. The _________________ methods are NotOverridable by default.12. The _______________ access modifier allows members of class to be accessible only from within their own class or

from a derived class.13. The _______________ access modifier allows members of class to be accessible only from within their declaration

context, including from any nested procedures.14. The _______________ access modifier allows members of class to be accessible only from everywhere(no

restriction).15. The ________________ namespace contains all the collection classes.16. The _________________ lets you assigns objects of a derived class to variables of the class’s base class.True/False1. If you dimension an array to have 100 elements, and decide at run-time that you now need the variable to hold 150

elements instead, it is possible to re-dimension an array to the new size.2. A SortedList is a Visual Basic .NET data structure which combines different properties of a Hashtable and an ArrayList.3. The elements of a SortedList can be access by either an index or unique key value.4. Abstraction gives a clear separation between properties of data type and the associated functions.5. Control class is a base class of all basic windows controls.6. Encapsulation binds the data and the functions into a single entity called object.7. A class is a reference type.8. Variables of a class can be assigned as null.9. A structure is a value type.10. The virtual keyword is used while defining a class to specify that the methods and the properties of that class can be

overridden in derived classes.11. You can declare an overridden method to be static if the original method is not static.12. Constructors do not have any return type.13. You can inherit private members of a class.14. Structures and classes are the two most important data structures that are used by programmers to build modular

programs by using OOP languages.15. .NET does not support multiple inheritance directly.