+ All Categories
Home > Documents > Department of Computer Science and Technology, UTU - 2015

Department of Computer Science and Technology, UTU - 2015

Date post: 04-Dec-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
27
MS. PREETI BHATT 1 Department of Computer Science and Technology, UTU - 2015 5 years Integrated M.Sc. (IT) – Semester 4 Practical List 060010401 – GUI Programming UNIT 1 Introduction to .NET Framework Short Questions 1. What is Microsoft .Net Framework? 2. List out the main component of .Net Framework. 3. What is .Net? 4. What is CLR? 5. List out the main functions of CLR. 6. What is CLS? 7. What is CTS? 8. Define is MSIL? 9. What makes deployment process simple in .Net Framework? 10. What do you mean by managed code? 11. What is unmanaged code? 12. What is Metadata? 13. What is base class Library? 14. What does JIT compiler do? 15. What is an Assembly? 16. Which is the base class for .NET class library? 17. What is garbage collector? 18. What namespace? 19. What is manifest? 20. List out methods that every data type must support? 21. How we can call garbage collector explicitly in the program. 22. List any eight CLS compliant “primitive types”. 23. Write the full form of following: a. CLR b. CTS c. CLS d. JIT e. CIL f. IL g. MSIL h. FCL i. BCL Long Questions 24. Explain .Net Framework with diagram. 25. What is CLR? How it will work? 26. What are the advantages of CLR?
Transcript

MS. PREETI BHATT 1

Department of Computer Science and Technology, UTU - 2015

5 years Integrated M.Sc. (IT) – Semester 4 Practical List

060010401 – GUI Programming

UNIT 1 Introduction to .NET Framework

Short Questions

1. What is Microsoft .Net Framework? 2. List out the main component of .Net Framework. 3. What is .Net? 4. What is CLR? 5. List out the main functions of CLR. 6. What is CLS? 7. What is CTS? 8. Define is MSIL? 9. What makes deployment process simple in .Net Framework? 10. What do you mean by managed code? 11. What is unmanaged code? 12. What is Metadata? 13. What is base class Library? 14. What does JIT compiler do? 15. What is an Assembly? 16. Which is the base class for .NET class library? 17. What is garbage collector? 18. What namespace? 19. What is manifest? 20. List out methods that every data type must support? 21. How we can call garbage collector explicitly in the program. 22. List any eight CLS compliant “primitive types”. 23. Write the full form of following:

a. CLR b. CTS c. CLS d. JIT e. CIL f. IL g. MSIL h. FCL i. BCL

Long Questions 24. Explain .Net Framework with diagram. 25. What is CLR? How it will work? 26. What are the advantages of CLR?

MS. PREETI BHATT 2

Department of Computer Science and Technology, UTU - 2015

27. What are the advantages of .Net Framework? 28. How the .Net Framework compiles and executes the program? 29. Which are the two categories in which type falls into? Differentiate these categories. 30. Write note on CTS. 31. Briefly describe how Common Type System made interfacing possible between programs written in

multiple languages. 32. Write note on CLS. 33. Write note on JIT. 34. Write note on BCL/FCL. 35. Write note on manage code. 36. Write note on namespace. 37. Write note assembly. 38. Write a brief note on garbage collection. 39. Explain the different types of projects that can be created using Visual Studio. 40. Write a brief note on IDE.

Multiple Choice Questions 41. Which of the following is responsible for multilingual support of .Net

a. Base class libraries b. Common Language Specification c. Garbage Collection d. Just In Time Compiler

42. When code is executed _____________load metadata into memory. a. Common language runtime b. Just In Time Compiler c. CLS d. .Net Framework libraries

43. Which of the following is not a .NET compatible language? a. C# b. J# c. VB.Net d. JAVA

44. 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 compiler

45. What is CTS in .NET? a. Defines rules concerning data types b. Defines a set of rules for all compilers to generate manage code for .NET c. Describes a set of features that different languages have in common d. None of the above

46. Types supported by CTS a. Value type b. Reference type c. Both

MS. PREETI BHATT 3

Department of Computer Science and Technology, UTU - 2015

d. None of them 47. Which of the following statement is not correct?

a. CLR is an execution engine of .NET b. Assembly is a logical unit of deployment c. CLR executes manage code d. .Net provides cross language interoperability using code access security

48. Which of the following is not true for garbage collection? a. It manages the reclamation of unused memory b. It deals with circular references c. You can be certain when an object will be reclaimed by garbage collector d. It disposes unreferenced objects

49. Which of the following is not JIT compiler type? a. Pre-JIT b. ECONO-JIT c. Normal-JIT d. Abnormal-JIT

50. When does Garbage collector run? a. Every one minute b. When application is running low on memory c. It runs randomly

51. 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 Above

52. What is false for CLR in .NET Framework? a. Manage code b. Database connectivity c. Memory management d. Cross language integration e. None of above

53. How many levels of compilation happens in .NET Framework? a. One b. Two c. Three d. Four

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

55. Content of assembly can be viewed using a. ILDASM.exe b. ILDASM.dll c. ILDASM.inc d. ILDASM.aspx

MS. PREETI BHATT 4

Department of Computer Science and Technology, UTU - 2015

56. Which of the following is not true for garbage collection? a. It manages the reclamation of unused memory b. It deals with circular references c. You can be certain when an object will be reclaimed by garbage collector d. It disposes unreferenced objects

Fill in the Blanks

57. Every data type supported by Common Type System is derived from _____________. 58. CIL stands for ___________________. 59. Reference type is converted into value type is called ____________________. 60. __________ is the root in .Net namespace. 61. __________ is the heart of .NET Framework 62. ____________of compilation happens in .NET Framework 63. Assembly store in a file is called ____________. 64. CTS data types are ________ and ____________. 65. Value type is stored in __________. 66. Reference type is stored in _____________. 67. The .Net program is compiled in to special type of code called ___________________. 68. This MSIL is turned into executable code using _____________ compiler. 69. Its function is to reclaim the memory when the object is no longer in use is known as

___________. 70. Managed code consists of ___________ and ________________. 71. When code is executed ____________ is used to discover information about your classes,

members, inheritance and so on. 72. The actual .Net code can be executed by _______________. 73. __________ contains information about the assembly and the resources.

True or False

74. .Net Framework supports many languages. 75. MSIL is not a CPU independent code. 76. CLR is a runtime environment of the .Net Framework. 77. JIT compiler converts the source code into native code. 78. .Net Framework is an operating system. 79. Source code written in any language is directly converted into native code in .Net Framework. 80. .Net Framework does not support web application development. 81. The code written in languages that conforms to the common language specification can be

executed by .Net Framework. 82. .Net Framework is language. 83. CLR converts the MSIL to native language. 84. Garbage collection is a function of CLR. 85. CLR is a language independent runtime environment. 86. .Net Framework supports cross language inheritance. 87. The same MSIL code can be executed on different operating system without rewrite the source

code.

MS. PREETI BHATT 5

Department of Computer Science and Technology, UTU - 2015

88. JIT compiler is a part of the runtime execution environment. 89. Any project that compiles to an EXE or DLL files produces an assembly in .NET. 90. CTS provide base set of Data Types which is responsible for cross language integration. 91. JIT call native code for execution just before when each function is called. 92. Once the destructor call then we can control them. 93. J# is supported by .NET framework. 94. Garbage collector runs randomly in VB.NET. 95. .NET Framework provides different programming models for Windows-based applications and

Web-based applications. 96. Garbage collector freeing memory occupied by unreferenced objects.

UNIT 2 Introduction to Visual Basic Programming

Short Questions

1. Define variable. 2. Define data type. 3. What is option strict statement? Give suitable example. 4. What is the range of character data type? 5. How to declare variable in vb.net? 6. What is dynamic array? 7. How to declare constant? 8. It is necessary to declare a variable? 9. Define dynamic array. 10. What is the use of REDIM Statement? 11. What is the use of PRESERVE keyword with REDIM Statement? 12. How to declare constant in vb.net? 13. What is the difference between implicit and explicit type conversion? 14. List out the various way to convert string into integer type in vb.net. 15. What is the difference between the operator / and \? 16. How to declare comment in vb.net? 17. What is the precedence of operator in vb.net? 18. What is enumeration? How do you create it? Give example. 19. Give the difference between procedure and functions. 20. Is it necessary to declare a variable? 21. What is the extension of visual basic solution file and form’s code file? 22. Write output for following code:

a. Module Module1 Sub Main()

Dim a(2) As Integer Dim i As Integer a(0) = 1 a(1) = 2 a(2) = 3 ReDim a(4)

MS. PREETI BHATT 6

Department of Computer Science and Technology, UTU - 2015

a(3) = 4 a(4) = 5 For Each i In a Console.Write( i + “ ”) Next Console.ReadKey() End Sub End Module

b. Module Module1 Sub Main()

Dim i, j, n As Integer i = 29 j = 5 n = i / j Console.WriteLine(n) Console.ReadKey() End Sub End Module

c.

Long Questions

23. Write a note on various Data Types in VB.NET. 24. Explain flow control statement. 25. Explain the use of ‘Continue’ and ‘Exit’ statements. 26. Explain option strict statement with suitable example. 27. Explain option explicit statement with suitable example. 28. Differentiate the following:

a. Do While...loop and Do....loop b. For...Next and For each...Next c. Do while...loop and Do until....loop

29. Write a sort note on ‘Select’ case. 30. Write a sort note on conditional statements. 31. Explain various option statements. 32. Compare select case with IF ELSE IF. 33. Write a sort note on string functions. 34. Write a note on type conversion functions. 35. Explain user define data type. 36. What is procedure? How it differ from function? How do we pass arguments in it? Explain with

example. 37. Explain Different Types of Errors and Exception 38. What is Array? Where it is helpful to its programmer. 39. What do you mean by variable lifetime and its scope? 40. What is Int32.TryParse ()? 41. What is Convert.ToInt32 ()? 42. How do you convert a string into an integer in .NET?

MS. PREETI BHATT 7

Department of Computer Science and Technology, UTU - 2015

43. What is the difference between a.Equals(b) and a == b? 44. Explain dynamic array with proper example. 45. Write about string function and methods. 46. Short note on date function. 47. Write note on exception handling? 48. Short note on structured exception. 49. Explain sub procedure and function with suitable example. 50. Explain the following in brief with appropriate examples:

a. MessageBox.Show(); b. .ToString(); c. For loop d. While loop e. For each loop

Multiple Choice Question

51. Which language is not a true object-oriented programming language? a. VB.NET b. VB 6 c. C++ d. C# e. Java

52. A GUI: a. Uses buttons, menus, and icons. b. Should be easy for a user to manipulate. c. Stands for Graphic Use Interaction. d. Both a and b. e. All of the above.

53. Which tool of Visual Basic .NET offers a quick look at the files associated with a given solution? a. Solution Explorer b. Properties Editor c. Task List d. Server Explorer

54. If you wanted to modify the characteristics of a control that you have used in your Visual Basic .NET project, you would use this tool: a. Solution Explorer b. Properties Editor c. Task List d. Server Explorer

55. This statement provides an alternate way of displaying information to the user, and is a good choice to use when it is important that the user reads your message. a. InputBox() b. MsgBox() c. AlertWindow() d. PromptUser()

56. How do you limit implicit type conversion in VB.NET?

MS. PREETI BHATT 8

Department of Computer Science and Technology, UTU - 2015

a. Option Strict On b. Option Strict=1 c. Options Strict True d. Option Strict off

57. Lower bound of array in VB.Net is a. 0 b. 1 c. -1 d. 2

58. What is the range of variable having Byte data type? a. 0-256 b. 0-255 c. 0-127 d. 0-128

59. Which of the following is not a valid data? a. Examdate = #01/01/2012# b. Examdate = 01/01/2012 c. Examdate = “January 5, 2012” d. Examdate = Now()

60. Which of the following is not part of the IDE: a. Code editor window b. Properties window c. Form layout window d. General window

61. The application name always appears in the: a. Properties window b. Intermediate window c. Code window d. Title bar

62. IDE is: a. Independent Development Enterprise b. A development environment for machine language c. A software project management tool d. An Integrated Development Environment for Visual Basic

63. What will be the output of following code? Sub Main()

Dim a(2) As Integer Dim i As Integer a(0) = 1 a(1) = 2 a(2) = 3 ReDim a(4) a(3) = 4 a(4) = 5 For Each i In a Console.Write(i)

MS. PREETI BHATT 9

Department of Computer Science and Technology, UTU - 2015

Next Console.ReadKey()

End Sub a. 00045 b. 00000 c. 12345 d. 01234

64. A control array is a list of controls with the a. different names b. same name c. both of above d. None of the above

65. _____ data contains only numbers, while ______ data may contain any symbol. a. Numeric, string b. String, numeric c. Constant, variable d. None of the above

66. The scope of a data item refers to: a. The relative freshness of the information in the data item b. The domain of procedures that are allowed to access the date item c. The size of the data item in relation to the rest of your program

d. None of the above 67. What will the message box display after the following lines of code execute?

Dim X As Integer Dim Y As Integer Dim Z As Integer Dim E As String = "Divide by Zero Error" Y = 4 X = (Y = (6 Mod Y)) Try Z = (X / Y) MsgBox(Z) Catch MsgBox(E) End Try

a. 4 b. 2 c. Divide by Zero Error d. None of the above

68. A statement block can consist of how many lines? a. 0 b. 2 c. An unlimited amount d. At most 255

69. What will the value of ThisExpression be after the following lines of code execute?

MS. PREETI BHATT 10

Department of Computer Science and Technology, UTU - 2015

Dim ThisExpression As Boolean Dim MyName = "John" ThisExpression = ((MyName = ("Jo" & "hn")) And (Not(0)))

a. False b. True c. “MyNameJohn0” d. “John”

70. Given the following section of code, if a programmer called the GetAge() subroutine, what value

would the message box display? Private Sub GetAge() Dim UserAge As String = 0 UserAge = InputBox("Enter your age","Get Age") ShowAge() End Sub Private Sub ShowAge() Dim UserAge As Integer = 0 MessageBox(UserAge) End Sub

a. Whatever the user entered in the GetAge() subroutine b. 0 c. 1 d. Nothing - this code will cause an error

Fill in the blanks

71. By default a variable of data type integer is initialized to ________. 72. The physical number of element store in array is ________. 73. Length of variable name must not exceed _________ characters. 74. ________________ property is used to make the form visible or invisible in Taskbar. 75. Active is a property of _____________ control. 76. _______________ tool used to pre compile a window application. 77. _______________ tool is use to modify configuration files. 78. ________________function is used to find the substring. 79. ____ is a structure or flow of control used to repeatedly execute a group of statements for a

specified time or range.

True and False 80. Finally block gets executed if the exception had not occurred. 81. Multiple catch blocks are executed. 82. Error viewer is a part of visual basic IDE. 83. J# is object oriented programming language supported by .NET Framework. 84. Dim MyAge As Integer

MyAge = "Twenty-five"

MS. PREETI BHATT 11

Department of Computer Science and Technology, UTU - 2015

85. When your program "throws an exception", this means that it is waiting for some piece of data to be returned to it before it can continue.

86. A variable that is declared inside of one procedure may be access by any other procedure. 87. A variable declared in a form's declarations section is said to have module-level scope, and is

therefore available to any procedure contained in that module. 88. Functions that take no parameters or arguments may have their parenthesis omitted when they

are called. 89. Numerical values may be compared, but string values may not be. 90. Arithmetic expressions are evaluated from left to right regardless of the expression being

evaluated.

Unit 3 GUI Design and Event Driven Programming

Short Questions

1. List any two properties of PictureBox control. 2. List out the possible StartPosition values of Form control. 3. How to load image in PictureBox control during runtime? 4. What is the use of Locked property of TextBox control? 5. List out four methods of Items collection of ComboBox control. 6. Give any one form controls methods. 7. How to fire an event; Give its code? 8. Explain use Mnemonic property of label control with suitable example. 9. Name two properties of Checked list box. 10. Explain any two dynamic properties textbox control. 11. What is the difference between panel and group box. 12. Explain any two Properties of masked textbox. 13. Explain the two method of combo box. 14. Explain two properties of list box which is available at run time. 15. Write a code to insert a picture on button control at runtime and also align picture at bottom

right. 16. Give the properties of progress bar. 17. What is the difference between panel and group box. 18. What is context menu? 19. How to create menu separator?

Long Questions

20. What is StartPosition of Form control? Explain it in brief. 21. Explain the Windows Forms with at least five properties other than common properties. 22. Explain the Selection properties of TextBox using example. 23. Explain the KeyPreview property of Form with examples. 24. Differentiate LinkLabel and Label controls. 25. Explain ListBox and ComboBox controls with its properties and methods. 26. Explain SelectedItems collection of ListBox control. 27. Explain Multiline and WordWrap property of TextBox control.

MS. PREETI BHATT 12

Department of Computer Science and Technology, UTU - 2015

28. Explain InputBox and MSgBox with syntax and examples. 29. What is procedure? How it differ from function? How do we pass arguments in it? Explain with

example. 30. Briefly describe the Items collection of ComboBox control and ListBox Control. 31. Discuss on form events. 32. Explain keyboard event with suitable example. 33. Explain mouse event with suitable example. 34. How events of control added during run time. 35. Explain the use of following control.

a. Masked textbox control b. Combo box control c. List box d. Combo box e. Radio Button

36. Explain combo box control with its properties and methods. 37. Explain scrollbar control with its properties and methods and events. 38. Write about image list and properties. 39. Write a code to populate list box. 40. Write note on tree view control. 41. Discuss image list box. How to add icon in tree view? 42. Write about timer control. 43. 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. 44. Short note on toolstrip. How to add button in the toolstrip during runtime? 45. Discuss on MDI. 46. Short note on MDI function and its properties.

Multiple Choice Question

47. The location of the form on the desktop during execution is determined by the: a. Form Designer window b. Project Explorer window c. Context Menu d. Form Layout window

48. Which are the standard prefixes for the Button and Combo box controls respectively in .NET? e. btn and chb f. btn and cbo g. bto and chb h. cmd and cbo

49. On start up, which of these window is not displayed ? a. The Blank Form window b. The Class window c. The Project window

d. The Properties window 50. Message boxes are used for

MS. PREETI BHATT 13

Department of Computer Science and Technology, UTU - 2015

a. when you want to ask the user a question b. display an error message c. advise the user

d. All the above 51. How many types of message boxes are there in VB?

a. 5 b. 6 c. 7 d. 8

52. What is tool tip text ? a. Tool tip text is a tip of the day b. Tool tip text does not exist c. Tool tip text is shown when the mouse is held over a object for a period of time

d. Tool tip text is the same as the caption

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

a. CheckBox Group b. RadioButton Group c. TextBox d. Label

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

a. Checked b. CheckState c. Both a and b d. None of the above

55. Visual Basic .NET's ______ ______ statement can handle conditions with multiple outcomes, as

opposed to the If...Then...Else statement, which can trigger only two possible outcomes. a. Select Case b. If Then c. Select Option d. Branch If

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

a. CheckBox Group b. RadioButton Group c. TextBox d. Button

57. Which is not a property of the Common control class? a. Show b. BackColor

MS. PREETI BHATT 14

Department of Computer Science and Technology, UTU - 2015

c. Font d. ForeColor e. Name

58. The Button control can be activated: 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.

59. 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.

60. 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.

61. Which is not a common control event? a. Click b. SingleClick c. DoubleClick d. MouseMove e. MouseDown

62. Which is not a valid value for the ListBox SectionMode Property? a. None b. One c. MultiSimple d. MultiExtended e. All of the above.

63. 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.

Fill in the blanks

64. ________________property is used to make the form visible or invisible in Taskbar. 65. Active is a property of _____________ control. 66. ________________ Property is used to get selected value from radio button.

MS. PREETI BHATT 15

Department of Computer Science and Technology, UTU - 2015

67. ________________property is used to hide the control. 68. _________________property determines whether a control is displayed to the user. 69. The CancelButton property belongs to ____________ object control? 70. The Tick event is found only in _______________ object control? 71. __________________ Method of a ListBox will remove just one item at a time? 72. ____________________ event is activated when a RadioButton is selected? 73. ______________ standard prefix for the name of a RadioButton? 74. ________________number of RadioButtons in a Group Box can be selected at the same time?

True / False

75. ToolTip is a property of control in VB.Net. 76. We cannot load image into PictureBox control at runtime. 77. The Minimum property of VScrollBar control can be negative number as well. 78. The default value of Maximum property in HScrollBar control is 10 79. The default value of Maximum property in TrackBar control is 10 80. 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.

81. The Exit Sub statement can be used prematurely end a subroutine, preventing any unnecessary processing from running.

82. If... statements can not be nested whatsoever due the complexity of this programming challenge. 83. 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. 84. Nested If statements can not be used to determine an outcome if the conditions used in the

statement are not related to each other.

UNIT 4 Object Oriented Programming in Visual Basic

Short Questions

1. Define overloading. 2. Define Shadowing. 3. How to create properties in class. 4. Define encapsulation. 5. What is the use of Shared property? How it will be accessed? 6. What you mean by shadowing? 7. What is the use of shared properties? How it will access? 8. Why we need to use the overrides keyword with Finalize method when working with destructor? 9. What is difference between Class And Interface? 10. Is it necessary to create an abstract class by using the MustInherit keyword? Why? 11. Finds out error from following code if any, otherwise write its output.

a. Public Class Mathematics Shared Data As Integer = 0

Shared Property Property1()

Get

Return Data

MS. PREETI BHATT 16

Department of Computer Science and Technology, UTU - 2015

End Get

Set(ByVal Value)

Data = Value

End Set

End Property

End Class

Sub Main()

Dim k As New Mathematics()

Console.WriteLine(k.property1)

Console.ReadKey()

End Sub

b. Public MustInherit Class AbstractClass Public MustOverride Function Add() As Integer

Public MustOverride Function Mul() As Integer

End Class

Public Class Calculation

Inherits AbstractClass

Public Overrides Function Mul() As Integer

Return i * j

End Function

End Class

c. Sub Main() Dim s As New Student()

Console.WriteLine(s.x)

Console.ReadKey()

End Sub

Public Class Student

Public x As Integer

Public Sub New(ByVal a As Integer)

x = a

End Sub

d. Sub Main() Dim a, b, c As Integer

b = 0

a = 1

On Error GoTo h

On Error GoTo -1

c = a / b

Console.WriteLine(c)

MS. PREETI BHATT 17

Department of Computer Science and Technology, UTU - 2015

Exit Sub

h:

MsgBox("Somthing is Wrong")

End Sub

Long Questions

12. Write down short note on object oriented programming. 13. Writ on creating properties event in a class. 14. Discuss on class modifiers. How to define a class? 15. Write about access modifiers used in class declaration. 16. How to create abstract class? Compare it with simple class. 17. Distinguish call by reference and call by value. 18. How interfaced-based polymorphism implements? Explain with example. 19. Discuss inheritance as a feature of OOP with suitable example. 20. Short note on inheritance. 21. How abstract class differs from interface? 22. What is an Interface? Explain it with appropriate examples. 23. Write on interface. Explain interfaced polymorphism. 24. 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 Question 25. An object is composed of:

a. Properties b. Methods c. Events d. Both a and b e. All of the above

26. Which statement about objects is true? a. One object is used to create one class b. One class is used to create one object c. One object can create many classes d. One class can create many objects e. There is no relationship between objects and classes

27. Which feature is needed to make a programming language object oriented? a.) Encapsulation b.) Inheritance c.) Polymorphism d.) Both a and b. e.) All of the above.

28. We should think of the practice of object-oriented programming as: a.) a simple answer to the complex problem of creating software.

MS. PREETI BHATT 18

Department of Computer Science and Technology, UTU - 2015

b.) an incremental improvement to the problem of creating software. c.) the way to get rid of a werewolf. d.) Both a and b. e.) All of the above.

29. 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 b. e.) All of the above.

30. 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 b. e.) All of the above.

31. 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 b. e.) All of the above.

32. When using encapsulation how should data be shared with external code? a.) Events b.) Methods c.) Properties d.) Private variables e.) Public variables

33. 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. None of the above.

34. 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.

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

MS. PREETI BHATT 19

Department of Computer Science and Technology, UTU - 2015

36. 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.

37. Which element of a class is optional? a.) Constructs b.) Fields c.) Methods d.) Properties e.) All of the above.

38. What is the suggested order for the definition of class elements from first to last? a.) Constructs, fields, methods, properties b.) Properties, constructs, fields, methods c.) Fields, properties, constructs, methods d.) Constructs, properties, fields, methods e.) Methods, constructs, properties, fields

39. 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

40. Which statement will call a constructor of a base class? a.) Base.New( ) b.) BaseConstructor.New ( ) c.) CallBase.New( ) d.) Constructor.New ( ) e.) MyBase.New( )

41. 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.

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

Fill in the blanks 43. ________________binds the data and the functions into a single entity called object. 44. _____________________means hiding of a data.

MS. PREETI BHATT 20

Department of Computer Science and Technology, UTU - 2015

45. Interface have only ______________ methods in their class. 46. _______________ statement will call a constructor of a base class. 47. To create abstract class _________ keyword is used. 48. _______________keyword is used to inherits class from parent class.

True / False

49. 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.

50. A SortedList is a Visual Basic .NET data structure which combines different properties of a Hashtable and an ArrayList.

51. The elements of a SortedList can be access by either an index or unique key value. 52. Abstraction gives a clear separation between properties of data type and the associated

functions. 53. C does not support encapsulations but support abentity called object. 54. Encapsulation binds the data and the functions into a single entity called object.

UNIT 5 Advanced GUI controls

Short Questions

1. Give any two methods of rich textbox. 2. Which method is used to add node of Treeview? 3. How to get selected node of tree view? 4. How to save content of rich textbox to .rtf file? 5. How to load content from .rtf file to rich textbox? 6. How to save content of rich textbox to .txt file? 7. How to load content from .txt file to rich textbox? 8. Which method is used to save file from rich textbox? 9. How to copy content from rich textbox? 10. How to color selected content of rich textbox? 11. How to bold selected content of rich textbox? 12. Which method is used to open a Print dialog box? 13. Which dialog box is used to save file? 14. Which dialog box is used with rich textbox to load content from .txt file from computer? 15. How to apply Font style to selected content of rich textbox using font dialog box? 16. How to count total number of node in Treeview?

Long Questions

17. Explain RichText Box with example. 18. Discuss on print dialog control. 19. Discuss on font dialog control. 20. How color dialog box is implements? 21. Explain file save dialog box use with important methods. 22. Explain ListView controls with its properties, methods and events. 23. What is the use of Treeview? Demonstrate it with proper example. 24. How to add node dynamically in Treeview?

MS. PREETI BHATT 21

Department of Computer Science and Technology, UTU - 2015

25. Discuss at least 5 methods related to formatting in rich textbox with example. 26. Discuss at least 5 methods, property and events of Treeview? 27. How to track node dynamically in Treeview? 28. Discuss important properties, methods and events of rich textbox.

Multiple Choice Question 29. What is the name of the control for putting menus on a form?

a. FormMenu b. MenuForm c. MenuControl d. MainMenu e. Menu

30. The standard prefix for a menu item is: a. men. b. meu. c. mit. d. mni. e. mnu.

31. Which menu object property places a check mark in the display of the menu text?

a. Check b. Checked c. CheckMark d. CheckOn e. RadioCheck

32. Which is not a standard dialog box? a. ColorDialog b. FontDialog c. OpenDialog d. PrintDialog e. ZoomDialog

33. Why are standard dialog boxes used? a. They are easy to create. b. They provide functionality familiar to users. c. Developers can create their own versions of Dialog boxes. d. Both a and b. e. All of the above.

34. How are dialog boxes implemented in a program a. A dialog box is generated programmatically. b. A dialog control is placed in the component tray. c. A dialog control is placed on the form. d. Both a and b. e. All of the above.

35. What is the method used to activate the color dialog box? a. ActivateDialog b. DisplayDialog c. ExhibitDialog

MS. PREETI BHATT 22

Department of Computer Science and Technology, UTU - 2015

d. ShowDialog e. StartDialog

36. The name of the class used to programmatically create a color dialog box is: a. Color b. ColorBox c. ColorDialog d. ColorDisplay e. ColorDisplayBox

37. The name of the class used to programmatically create a font dialog box is: a. Font b. FontBox c. FontDialog d. FontDisplay e. FontDisplayBox

38. Which OpenFileDialog control property specifies the choices in the “Files of type” dropdown box? a. FileName b. FileNames c. FileType d. Filter e. FilterIndex

39. Which property is the same in the OpenFileDialog and the SaveFileDialog control? a. FileName b. Filter c. InitialDirectory d. Both a and b. e. All of the above.

Fill in the blanks 40. __________________class used to programmatically create a font dialog box. 41. __________________class used to programmatically create a color dialog box. 42. __________________class used to programmatically create a save dialog box. 43. The standard prefix for a menu item is________________________.

UNIT 6 ADO.NET Programming

Short Questions

1. What is use of command object? 2. Give any two properties of list box which is usual to connect to a database. 3. Define dataset. 4. Which namespace is used for SQL Server database connectivity? And write one line code to make

connection with it. 5. What is data binding? 6. Give the method to move to last record in the dataset. 7. List out the methods of command object. 8. What is the difference between datagrid and gridview?

MS. PREETI BHATT 23

Department of Computer Science and Technology, UTU - 2015

Long Questions

9. Write about data adapter. 10. Write on ADO.NET architecture. 11. Write note on ADO.NET object model. 12. Write about dataset and give the code to create dataset. 13. Write code of parse parameter in to an SQL query. 14. Write a step to connect oracle database and write a step to execute DML statements. 15. Write step to execute DML statements and to perform record navigation operation to oracle

database. 16. What is ADO.NET? Explain ADO.NET architecture with diagram. 17. How to bind DataGridView control with dataset? Explain with example. 18. Give code to execute DML statements using command object and perform record navigation in

DataGridView control. 19. What is ADO.NET? Explain ADO.NET architecture with necessary diagram. 20. Write a brief not on DataSet object model.

Multiple Choice Question

21. Which is the base class for TypedDataset a. DataReader b. Dataset c. DataAdapter

22. ADO.NET provides the ability to create and process in-memory databases called: a. Views b. Tables c. Relations d. Datasets

23. Which is the best to retrieve Read-Only, Forward-only stream of data from database a. Data Set b. Typed Data Set c. DataReader

24. The DataAdapter uses which of the following object to retrieve the data from database a. Connection b. Command c. DataReader

25. Which of the following is not true about ADO.NET?

a. ADO.NET enables to create distributed data sharing applications b. ADO.NET uses XML to transfer data across applications and data source c. ADO.NET doesn't support disconnected architecture d. The classes of ADO.NET are defined in the System.Data namespace

26. Which of the following illustrates the benefit of ADO.NET? a. Interoperability b. It uses DataSet to represent data in memory that can store data from multiple tables

and multiple sources.

MS. PREETI BHATT 24

Department of Computer Science and Technology, UTU - 2015

c. Disconnected data access d. All of above

27. The Databases that make up the data in a dataset a. Should be from Single database source b. Can be from multiple databases bases which are homogeneous c. Can include many heterogeneous databases sources d. None of the above

28. Which of the following is the object of .NET data provider? a. Connection b. Command c. Data Reader d. All of above

29. When you create a relationship between tables in ADO.NET DataSet a. a UniqueConstraint is added to the parent table b. a ForeignKeyConstraint is added to the child table by default c. Both a and b

30. Which of the following is not true for ADO.NET DataSet? a. DataSet provides a disconnected view of a data source. b. Dataset enables to store data from multiple tables and multiple sources c. We can create relationship between the tables in a DataSet d. All of above are true

31. Which of the following method of the command object is best suited when you have aggregate functions in a SELECT statement?

a. ExecuteScalar b. ExecuteReader c. ExecuteNonQuery

32. Which of the following is the event that is exposed by the DataTable object? a. RowChanged b. ColumnChanged c. RowChanging d. All of above

33. Which of the following is not the method of DataAdapter? a. Fill b. FillSchema c. ReadData d. Update

34. Which of the following is the method provided by the DataSet object to generate XML? a. ReadXML b. WriteXML c. GetXML d. All of the above

35. Which.Net Data Provider offers best performance when connected to SQLServer Database ? a. OLEDB provider b. ODBC provider c. SQLServer .NET Data Provider d. SQLServer Data Provider

MS. PREETI BHATT 25

Department of Computer Science and Technology, UTU - 2015

36. What is the Best approach that has to be used, if you need continuous connection to the Database?

a. ADO.NET b. ADO c. Both d. None of the above

37. Which of the following statements is true about Dataset? a. Dataset can store only one table in its cache b. Dataset stores tables in the cache,only when cache set to true c. Dataset cannot store any tables in the cache

d. Dataset can store multiple tables in cache 38. In ADO, the data from one component to other is sent in Binary format, where as in ADO.Net it is

sent in a. Binary format only b. Text Stream c. XML Format d. None of the above

39. Which object of ado.net has the best performance, for retrieving the data a. Data set b. Data reader c. Data provider d. Data adaptor

40. No of records in memory at any given point of time when the DataReader reads the Data a. All reacords pulled by the reader b. Only one record at a time c. Depends on the data provider d. Depends on the data source

41. Which type of Dataset supports schema ? a. Typed b. Untyped c. Mixed d. All

42. Which of the following Namespace is used for better performance when connecting to SQLServer?

a. System.Data b. System.Data.SQLClient c. System.Data.Oledb d. System.Data.OracleClient

43. If the DSN (Data Source Name) has to be used with SQL Server, which namespace has to be imported?

a. System.Data.ODBC b. System.Data.SQLClient c. System.Data.Oledb d. System.Data.OracleClient

44. When we need to retrieve only a single value from the Database,which Method is efficient a. ExecuteReader() b. ExecuteScalar()

MS. PREETI BHATT 26

Department of Computer Science and Technology, UTU - 2015

c. ExecuteNonQuary() d. ExecuteXmlReader()

45. Two users are trying to update the row in a database at the same time.Assuming that optimistic concurrency is not used for concurrency control in this case, what will be the result ?

a. The Second Update overwrites the first update b. Error will be raised when the Second update happens c. Second update does not happen at all d. None of the above

46. Where is a single element of data stored? a. Field b. Record c. Table d. Both a and b. e. All of the above.

47. Where is a collection of related data elements stored? a. Field b. Record c. Table d. Both a and b. e. All of the above.

48. Which is not a program that can create a database? a. Access b. MySQL c. Oracle d. SQL Server e. All of the above can be used to create a database.

49. Which database is the ADO.NET SqlConnection object designed for? a. Access b. Microsoft SQL Server c. MySQL d. Oracle e. None of the above.

50. Which is not an ADO.NET DataAdapter Object? a. OleDbDataAdapter b. SQLDataAdapter c. QueryDataAdapter d. Both a and b. e. All of the above.

51. Which type of object has the Generate Dataset method? a. Adapter object b. Connection object c. Database object d. Dataset object e. None of the above.

52. Which object contains the Position property of the current record in a dataset? a. BindingContext

MS. PREETI BHATT 27

Department of Computer Science and Technology, UTU - 2015

b. BindingData c. DataBinding d. DataBound e. DataContext

53. The first record in a dataset has a position property of: a. Zero b. One c. Any value defined by the programmer. d. Both a and b. e. All of the above.

54. Which below is specified by the DataMember Property? a. Connection object b. DataAdapter object c. Database field d. Database table e. Dataset object

55. Which is a property of the DataGrid control? a. DataMember b. DataSource c. DataQuery d. Both a and b. e. All of the above

Fill in the blanks 56. ___________________ method is use, when records neither are nor returned from the database. 57. OLEDB Connection Pooling is handled by OLEDB.Net Provider and SQLClient Connection pooling is

handled by ________ . 58. _________________object in ADO.Net is similar to the Recordset object of ADO. 59. _________ method of DataAdapter is uesd to populate the data set. 60. Visual Basic uses an object called ______ to hold your table.

True / False 61. DataAdapter object populates a DataSet and resolves updates with the data source. 62. After a DataProvider object is instantiated and properly assigned, you can directly query a

database. 63. If a given entity is said to have a "one-to-many" relationship with another entity, this means that

any given row of the first table can have a relation to one or many other tables in the database 64. The Databases that make up the data in a dataset should be form single database source. 65. Dataset can store only one table in its cache. 66. Before performing any operations on a database from your Visual Basic .NET application, it is

necessary to create a connection to whichever database you would like to access. 67. Mixed type of dataset support schema. 68. ADO.NET is faster than ADO on all counts of connected and disconnected recordsets 69. All records fetch by the DataReader from memory at a time. 70. ADO.NET does not have the inherent cursor object but has data classes that include functionality

of cursors. 71. ADO.NET is faster than ADO for disconnected RecordSets.


Recommended