mcq
DESCRIPTION
MCQ'z Related to ProgrammingTRANSCRIPT
![Page 1: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/1.jpg)
Exam/R12/Module-I/IPL
MCQModule 1 – Introducing the programming
Chapter 06: Using Compound Assignment and Iteration StatementsQ1. Consider the following statement
remainder = remainder %n which one is equivalent to the above expression
A. remainder =% nB. remainder %= nC. remainder = n%D. remainder = %n
Answer: B [Page 80-81]
Q2. Which of the following increments a value by one?A. ++B. +1C. 1+lD. >+
Answer: A [page 81]
Q3. What is a sentinel variable?A. This variable which changed inside the loopB. The variable whose value causes a loop to exit earlyC. The variable in a loop controls the number of iterations that it performs D. None
Answer: C [page 82]
Q4. How many times the loop will repeat?for(int i=1; ;i++){
//code}
A. 0B. 1C. This loop will never terminateD. This loop will not compile
Answer: C [Page 82]
Q5. How many times the loop will repeat?for(int i=1; ;i++){
//codeif(i==10) break;
}A. 0B. 1C. 10D. This loop will not compile
Answer: C [Page 82]
Q6. Will the following loop compile?for( ; ; ){
}A. YesB. No
Answer: A [Page 82. You must make the loop to terminate somehow]
Q7. What will be the output the following loop?for(int i=1; i<=3; i++){
if(i==2) break;Console.Write( i + “ “);
}A. 1 2 3B. 1 2C. 1
Md. Habibul Haq BITL 1
![Page 2: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/2.jpg)
Exam/R12/Module-I/IPL
D. 1 3Answer: C [Page 88]
Q8. What will be the output the following loop?for(int i=1; i<=3; i++){
if(i==2) continue;Console.Write( i + “ “);
}A. 1 2 3B. 1 2C. 1D. 1 3
Answer: D [Page 88]
MCQModule 1 – Introducing the programming
Chapter 07: Managing Errors and Exceptions
Q1. C# makes it easy to separate the error handling code from the code that implements themain flow of the program by _________________________.
E. using exceptions and exception handlersF. using checked and unchecked operationsG. using error handlerH. none
Answer: A [Page 98]
Q2. What is the purpose of catch handler in an exception handling mechanism?A. to catch and handle a specific type of exception,B. to prevent program from crushingC. to report about errors to runtimeD. to trap data loss
Answer: A [page 81]
Q3. What happens if any statement inside a try block generates error?A. The runtime throws an exception and transfers control to the finally blockB. The runtime throws an exception and transfers control directly to the first matching catch handlerC. The runtime throws an exception and stops the execution of programD. The runtime throws an exception and transfers control to error routine
Answer: A [page 99]
Q4. Which of the following is or are valid?E. try
{//..
}catch{
//...}
F. try{
//..}finally{
//...}
G. try{
//..}catch(InvalidCastExceprion ex1){
//...}catch(Exceprion ex2)
Md. Habibul Haq BITL 2
![Page 3: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/3.jpg)
Exam/R12/Module-I/IPL
{//...
}finally{//...}
H. try{
//..}
catch(Exceprion ex2){
//...}catch(InvalidCastExceprion ex1){
//...}finally{
//...}
Answer: A, B, D [C incorrect. Narrower type exceptions must be before broader type]
Q5. What happens if a try block throws an exception and there is no corresponding catch handler?A. The runtime executes its own error routine and executes next statementB. The runtime exits the try block and tries to execute statement immediately after the try block.C. The program terminates with an unhandled exception D. None of the above
Answer: C [Page 100]
Q6. Consider the code blockchecked{ int willThrow = number++;
} what will happen when the code executes?
E. OverflowException will be thrownF. value of number will be truncatedG. code will not compileH. none
Answer: A [Page 107]
Q7. Consider the code blockunchecked{ int willThrow = number++;
} what will happen when the code executes?
A. OverflowException will be thrownB. value of number will be truncatedC. code will not compileD. none
Answer: B [Page 107]
Q8. The throw statement needs __________ object to throw.E. an exceptionF. an errorG. a System.object type H. A disposable type
Answer: A [Page 82]
Q9. All integer arithmetic in a ______ statement always throws an OverflowException.A. checkedB. unchecked
Md. Habibul Haq BITL 3
![Page 4: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/4.jpg)
Exam/R12/Module-I/IPL
C. loopD. decision
Answer: A [Page 107]
Q10. Which type of overflow exception is checked inside a checked block?A. Only floating point arithmeticB. Only integer arithmeticC. Only stack overflowD. All of the above
Answer: B [Page 107]
Q11. What happens if any statement inside a checked block is a method call?A. checking applies to code that runs in the method that is calledB. checking does not apply to code that runs in the method that is calledC. C# does not allow method call inside a checked blockD. None of the above
Answer: B [Page 107]
Q12. All integer arithmetic in an _____ block is not checked and never throws an OverflowException.A. checkedB. uncheckedC. loopD. decision
Answer: B [Page 107]
Q13. Which data type is checked for overflow inside a checked block?A. intB. longC. floatD. double
Answer: A, B [Page 107]
Q14. You can use the checked and unchecked keywords to control floating-point (non-integer) arithmetic.A. TrueB. False
Answer: B [Only integer arithmetic. Page 107]
Q15. We can throw an exception by using the ______A. raiserror method of the object classB. throw statementC. checked statementD. unchecked statement
Answer: B [page109]
MCQModule 1 – Introducing the programming
Chapter 08: Creating and Managing Classes and Objects
Q1. __________ provide a convenient mechanism for modeling the entities manipulated by applications.E. Classes,F. ObjectsG. NamespacesH. Enumerations
Answer: A [page 116]
Q2. What do you do when you design a class? A. you systematically arrange information into a meaningful entity,B. you group information for global access C. you protect your information from being altered D. you write statemnts to manipulate information from database
Answer: A [page 116]
Q3. Encapsulation is sometimes referred to as ________________E. polymorphism F. abstractionG. groupingH. information hiding
Md. Habibul Haq BITL 4
![Page 5: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/5.jpg)
Exam/R12/Module-I/IPL
Answer: D [page 116]
Q4. What are the purposes of encapsulation?I. To combine methods and data inside a class J. To control the accessibility of the methods and data K. To protect data from malicious use L. To hide objects from applications
Answer: A, B [Page 116]
Q5. Which keyword is used to create new instance of a class?E. createF. openG. new H. object
Answer: C [Page 117]
Q6. A method or field in a class is said to be ___________ if it is accessible only from inside the class.A. publicB. protectedC. internalD. private
Answer: D [Page118]
Q7. A method or field in a class is said to be ___________ if it is accessible from inside the class and subclasses of the class.
A. publicB. protectedC. internalD. private
Answer: B [Page118]
Q8. A method or field in a class is said to be ___________ if it is accessible both from inside and outside the class A. publicB. protectedC. internalD. private
Answer: A [Page118]
Q9. A method or field in a class is said to be ___________ if it is accessible both from outside the class but within the same assembly.
A. publicB. protectedC. internalD. private
Answer: C [Page118]
Q10. Which of the following is or are true about constructors?A. A Constructor is a special method called automatically when a new instance of the class is createdB. A constructor has the same name as the classC. A constructor has no return typeD. A constructor cannot take parameters
Answer: A, B, C [D incorrect. Constructors can take parameters. Page 119]
Q11. What happens if you do not write any constructor for your class?A. You cannot create objects from the classB. You class does not compileC. Compilers generate a default constructor for youD. You class is treated as a structure
Answer: C [Page 119]
Q12. Constructors do not support overloading.A. TrueB. False
Answer: B [Reverse is true, page 120]
Q13. Which of the following is or are true about static members?A. static members are class members rather than object (instance) memberB. To access static member, you do not need to create objectC. static members are sharedD. Only one copy of a static member is created irrespective of how many object is created
Answer: A, B, C, D [page 129-130]
Q14. A static class can contain both static and non-static members.
Md. Habibul Haq BITL 5
![Page 6: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/6.jpg)
Exam/R12/Module-I/IPL
A. TrueB. False
Answer: B [A static class can contain only static members. Page 131]MCQ
Module 1 – Introducing the programmingChapter 09: Understanding Values and References
Q1. Which of the following is NOT a value type?.I. int,J. BooleanK. string L. Char
Answer: c [page 136]
Q2. Consider the methodvoid ChangeValue( int i ){ i++;}Now consider the following statementsint a=10;ChangeValue( a );Console.WriteLine( a );What is the output?
E. 0F. 10G. 11H. null
Answer: B [page 136]
Q3. Value types are some time called ________________I. direct typeJ. indirect typeK. structuresL. enumerations
Answer: A [page 136]
Q4. Reference types are some time called ________________A. direct typeB. indirect typeC. structuresD. enumerations
Answer: B [page 136]
Q5. Consider the statementSystem.Windows.Forms.TextBox t;
What value does the reference t hold?I. emptyJ. 0K. nullL. nothing
Answer: C [Page 136-138]
Q6. Consider the two statementsStatement I: int i=null;Statement II: Object o = null;
Now which statement or statements are valid?E. Statement I F. Statement II G. Both Statement I and Statement II H. Neither of the two
Answer: B [Page136-38, null can be assigned to reference types only But C# 2.0+ supports nullable type, you make value type nullableThe code will look like belowint? i = null;]
Q7. Consider the code snippetstatic void DoWork(out int param){ param++;}
Will this compile?
Md. Habibul Haq BITL 6
![Page 7: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/7.jpg)
Exam/R12/Module-I/IPL
E. YesF. No
Answer: B [Page141 to 145The method must assign value to out parameters]
Q8. Converting a value type into reference type is called______ E. castingF. explicit castingG. boxingH. unboxing
Answer: C [Page148]
Q9. Converting a reference type into value type is called______ A. castingB. explicit castingC. boxingD. unboxing
Answer: D [Page148]MCQ
Module 1 – Introducing the programmingChapter 10: Creating Value Types with Enumerations and Structures
Q1. C# allows creating two user defined value types. They are:M. classesN. objectsO. structuresP. enumerations
Answer: C, D [page 154]
Q2. Enumeration variable live on ___________I. the stackJ. the heapK. unmanaged memoryL. none of the above
Answer: A [page 155]
Q3. Underlying type of an enumeration is always ______M. integral typeN. floating typeO. string typeP. reference type
Answer: A [page 155, byte, sbyte, short, ushort, int, uint, long or ulong. Default int]
Q4. Underlying type of an enumeration defaults to_______A. shortB. intC. longD. float
Answer: B [page 155]
Q5. ____ is like a class but is a value type.M. An enumerationN. A delegateO. An eventP. A structure
Answer: D [Page 159]
Q6. You can use operators such as the equality operator (==) and the inequality operator (!=) on your own structure type variables since they are value types.
I. TrueJ. False
Answer: B [Page161, you cannot use operators such as the equality operator (==) and the inequality operator (!=) on your own structure type variables even though they are value types]
Q7. You can declare a default constructor (a constructor with no parameters) for a structureA. YesB. No
Answer: B [Page 161. No, you cannot]
Q8. If you declare your own constructor in a structure, will the compiler still generate the default constructor.I. TrueJ. False
Md. Habibul Haq BITL 7
![Page 8: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/8.jpg)
Exam/R12/Module-I/IPL
Answer: A [Page163. This is not true for classes]
MCQModule 1 – Introducing the programmingChapter 11: Using Arrays and Collections
Q1. What is an array?Q. Ordered sequence of elements R. Unordered sequence of elements S. Random sequence of element. T. None of the above
Answer: A [page 170]
Q2. Which of the following is or are true about arrays?M. All the elements in an array have the same typeN. All elements in an array has the same name but each has different indexO. Number of elements in array are fixed cannot be changed once createP. An array itself is a value type
Answer: A, B, C [page 170. An array itself is a reference type]
Q3. Arrays are _______, regardless of the type of their elements.Q. value typeR. reference typeS. integral typeT. null type
Answer: A [page 170]
Q4. Array index starts from ___E. 0F. 1G. How programmers decidesH. None of the above
Answer: A [page 170. Array index is 0 based in c#]
Q5. What happens If you specify an index that is less than 0 or greater than or equal to the length of the array.Q. Null is returnedR. 0 value is returned S. The compiler throws an IndexOutOfRangeException,T. Nothing hppenns
Answer: C [Page 173]
Q6. If you want to iterate through only a known portion of an array (for example, the fi rst half) or to bypass certain elements (for example, every third element), it’s easier to use a foreach statement..
K. TrueL. False
Answer: B [Page174, for statement is useful here]
Q7. The for statement is the preferred way to iterate through an arrayC. trueD. false
Answer: B [Page 174. foreach statement is useful here]
Q8. 18. Where the collection classes are live in?A. A. In systemB. B. In .NET Frame workC. C. In System. CollectionD. D. In System. Collections namespace & sub-namespace
Answer: D [Page 176]
Q9. The basic collection classes accept, hold, and return their elements as _______.A. objectsB. integersC. value typesD. enumerations
Answer: A [Page 176]
Q10. The ____ class implements a first-in, first-out (FIFO) mechanism.A. ArrayListB. HashtableC. Stack
Md. Habibul Haq BITL 8
![Page 9: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/9.jpg)
Exam/R12/Module-I/IPL
D. QueueAnswer: D [Page 179]
Q10. The ____ class implements a last-in, first-out (LIFO) mechanism.A. ArrayListB. HashtableC. StackD. Queue
Answer: C [Page 180]
Q11. The _____ class is often called associative array.A. ArrayListB. HashtableC. StackD. Queue
Answer: B [Page 182]
Q12. A Hashtable can contain duplicate keys.A. TrueB. False
Answer: B [Page 182. A Hashtable cannot contain duplicate keys]MCQ
Module 1 – Introducing the programmingChapter 12: Understanding Parameter Arrays
Q1. ____________ is the technical term for declaring two or more methods with the same name in the same scopeU. Overloading V. OverridingW. InheritanceX. Casting
Answer: A [page 192]
Q2. What is a variadic method?Q. a method that returns only value typesR. a method that returns a variable type of informationS. a method that takes a variable number of argumentsT. a method that takes a fixed number of arguments
Answer: C [page 192]
Q3. You can overload a method based solely on the params keywordU. TrueV. False
Answer: B [page 195// compile-time error: duplicate declarationpublic static int Min(int[] paramList)...public static int Min(params int[] paramList)..]
Q4. A params array can be the first parameterI. TrueJ. False
Answer: B [page 195. A params array must be the last parameter.// compile-time errorpublic static int Min(params int[] paramList, int i)...// okpublic static int Min(int i, params int[] paramList)...
]Q5. What happens If you specify an index that is less than 0 or greater than or equal to the length of the array.
U. Null is returnedV. 0 value is returned W. The compiler throws an IndexOutOfRangeException,X. Nothing happens
Answer: C [Page 173]
Q6. If you want to iterate through only a known portion of an array (for example, the fi rst half) or to bypass certain elements (for example, every third element), it’s easier to use a foreach statement..
M. TrueN. False
Md. Habibul Haq BITL 9
![Page 10: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/10.jpg)
Exam/R12/Module-I/IPL
Answer: B [Page174, for statement is useful here]
Q7. The for statement is the preferred way to iterate through an arrayE. trueF. false
Answer: B [Page 174. foreach statement is useful here]
Q8. 18. Where the collection classes are live in?E. In systemF. In .NET Frame workG. In System. CollectionH. In System. Collections namespace & sub-namespace
Answer: D [Page 176]
Q9. The basic collection classes accept, hold, and return their elements as _______.E. objectsF. integersG. value typesH. enumerations
Answer: A [Page 176]
Q10. The ____ class implements a first-in, first-out (FIFO) mechanism.E. ArrayListF. HashtableG. StackH. Queue
Answer: D [Page 179]
Q10. The ____ class implements a last-in, first-out (LIFO) mechanism.E. ArrayListF. HashtableG. StackH. Queue
Answer: C [Page 180]
Q11. The _____ class is often called associative array.E. ArrayListF. HashtableG. StackH. Queue
Answer: B [Page 182]
Q12. A Hashtable can contain duplicate keys.C. TrueD. False
Answer: B [Page 182. A Hashtable cannot contain duplicate keys]MCQ
Module 1 – Introducing the programmingChapter 13: Working with Inheritance
Q1. The _______ inherits from the base class.Y. Child classZ. New calssAA. Derived class BB. System.Object class
Answer: C [page 202]
Q2. In c#, a class is allowed to derive from two or more classes.U. TrueV. False
Answer: B [page 202A class is not allowed to derive from two or more classes]
Q3. Which keyword is used to prevent a class from being inherited?W. staticX. voidY. sealedZ. const
Answer: C [page 202]
Q4. Which keyword do you use to refer a base class’s member from the derived class?
Md. Habibul Haq BITL 10
![Page 11: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/11.jpg)
Exam/R12/Module-I/IPL
K. superL. parentM. thisN. base
Answer: d [page 204 ]
Q5. What do you call the method if a derived class declares a method that has the same signature as one in its base class?
Y. null methodZ. new method AA. virtual method,BB. overloaded method
Answer: B [Page 207]
Q5. A method that is intended to be overridden is called a ___________.A. null methodB. new method C. virtual method,D. overloaded method
Answer: C [Page 208]
Q7. What do you call the concept “providing different implementations of the base class’s method in a derived class”?
G. OverloadingH. OverridingI. HidingJ. casting
Answer: B [Page 208.]
Q8. C# methods are virtual by default.I. TrueJ. False
Answer: B [Page 209. C# methods are not virtual by default. Java methods are virtual by default]
Q9. You’re allowed to define static fields in an interface.I. TrueJ. False
Answer: B [Page 213You’re not allowed to define any fields in an interface, not even static ones]
Q10. Which class does not allow creating create instances of it?I. Abstract classJ. Sealed classK. Interface classL. All of the above
Answer: A [Page 219]
Q11. Which keyword is used to prevent a class from being used as a base classI. abstractJ. virtualK. sealedL. override
Answer: C [Page 220]
MCQModule 1 – Introducing the programming
Chapter 14: Using Garbage Collection and Resource Management
Q1. Which symbol precedes before the destructor in a class?.CC. A hash(#)DD.A pipe(|)EE. A tilde (~) FF. A minus (-)
Answer: C [page 230]
Q2. You can declare a destructor in a value type, such as a struct.W. TrueX. False
Answer: B [page 231]
Q3. You never declare a destructor with parametersA. True
Md. Habibul Haq BITL 11
![Page 12: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/12.jpg)
Exam/R12/Module-I/IPL
B. FalseAnswer: A [page 232]
Q4. The process of destroying an object and returning memory back to the heap is known as ________O. Memory management P. Resource collectionQ. Garbage collectionR. Destruction
Answer: C [page 230]
Q5. How can you release the resource yourself as quickly as possible?CC. by defining destructorsDD.by creating a disposal method EE. by overriding ,finalize methodFF. None of the above
Answer: B [Page 234]
Q6. The _______ statement provides a clean mechanism for controlling the lifetimes of resourcesE. doF. usingG. switchH. checked
Answer: B [Page 236]
MCQModule 1 – Introducing the programming
Chapter 15: Implementing Properties to Access Fields
Q1. Calling a method to achieve the effect on a field feels a little clumsy. What then does alleviate this awkwardness?
GG.PropertiesHH. EventsII. Constructors JJ. All of the above
Answer: A [page 244]
Q2. What is a property of a class?Y. A property is a cross between a field and the constructorZ. A property is a cross between a field and a method AA. A property is a bridge between a field and its consumerBB. None of the above
Answer: B [page 246]
Q3. ______________looks like a field but acts like a method.C. A PropertyD. A methodE. A public fieldF. An Event
Answer: A [page 246]
Q4. The _____ block of a property contains statements that execute when the property is read.S. get T. setU. wholeV. none of the above
Answer: A [page 247]
Q5. The _______ block of a property contains statements that run when the property is written toA. get B. setC. wholeD. none of the above
Answer: B [page 247]
Q6. Which one is a read-only property?GG.The property that contains only get blockHH. The property that contains only set block II. The property that contains both get and set blockJJ. None of the above
Answer: A [Page 248]
Md. Habibul Haq BITL 12
![Page 13: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/13.jpg)
Exam/R12/Module-I/IPL
Q7. Which one is a write-only property?A. The property that contains only get blockB. The property that contains only set block C. The property that contains both get and set blockD. None of the above
Answer: B [Page 249]
Q6. You can use a property as a ref or an out argument to a method.I. TrueJ. False
Answer: B [Page 251]
Q7. The get and set accessors can take any parameters.A. TrueB. False
Answer: B [page 251]
Q8. Which special variable holds the value assigned to the set accessor of a property?A. dataB. valueC. argsD. param
Answer: B [Page 151]
MCQModule 1 – Introducing the programming
Chapter 16: Operator Overloading
Q1. Which one defines whether the operator evaluates from left to right or from right to left?KK. Operator precedenceLL. Operator overloadingMM. Operator associativityNN. None of the above
Answer: C [page 258]
Q2. Which type of operator operates on just one operand?CC. Unary operatorDD.Binary operatorEE. Trinary OperatorFF. None of the above
Answer: A [page 258]
Q3. Which type of operator operates on two operands?A. Unary operatorB. Binary operatorC. Trinary OperatorD. None of the above
Answer: B [page 258]
Q4. Which of the following is a unary operator?G. +H. +=I. ?J. ++
Answer: D [page 258]
Q5. You can change the precedence and associativity of an operator.W. TrueX. False
Answer: A [page 258, No. you cannot]
Q6. In c#, you can invent new operator symbolsA. TrueB. False
Answer: B [page 247, you can only overload existing operators]
Q7. Which operator you cannot overload?KK. Plus (+)LL. Increment (++)MM. Equality (==)NN. Dot (.)
Answer: A [Page 259]
Md. Habibul Haq BITL 13
![Page 14: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/14.jpg)
Exam/R12/Module-I/IPL
Q8. Which of the following should be true while overloading operators?E. All operators must be publicF. All operators must be staticG. virtual, abstract, override, or sealed modifiers cannot be usedH. overloaded cannot take any parameter
Answer: A, B, C [Page 259. Binary operators must accept two arguments and unary operator must accept one operator]
Q9. Which of the operators must be overloaded as pairs?.K. == and !=L. < and >M. <= and >=N. + and -
Answer: A, B, C [Page 266]
Q10. Which one is implicit casting?A. double d; int a = 20; d = a;B. int a; double d=2.33; a = (int)dC. int a = Convert.ToDouble( “20.33”);D. None of the above
Answer: A [Page 270]
Q11. Which one is explicit casting?A. double d; int a = 20; d = a;B. int a; double d=2.33; a = (int)dC. int a = Convert.ToDouble( “20.33”);D. None of the above
Answer: B [Page 270]
MCQModule 1 – Introducing the programming
Chapter 17: Introducing the Windows Dorms
Q1. Which property of a windows form should you change to set the text shown on the title bar?OO.TitlePP. TextQQ.TitleTextRR. You cannot change that
Answer: B [page 278]
Q2. Which is the statement for running an application form?A. Application.Run( Form instance);B. System.Run(Form instance);C. Form.Run(Form instance);D. None of the above.
Answer: A [page 280]
Q3. Which property of a form can be used to control the level of transparency?E. Opacity F. BackColorG. TransparencyH. None of the above
Answer: A [page 278]
Q4. Which property of a form returns the control that is currently in focus?K. CurrentControlL. FocusedControlM. ActiveControlN. TabIndex
Answer: C [page 278]
Q5. What is the purpose of the implemented Dispose method in windows form control?.Y. To close the formZ. To hide the formAA. To release unmanaged resources as quickly as possibleBB. None of the above
Answer: C [page 281]
Q6. Which visual studio generated method instantiate all controls you added to a form and set their properties, wires event handler with controls?
C. Initialize
Md. Habibul Haq BITL 14
![Page 15: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/15.jpg)
Exam/R12/Module-I/IPL
D. InitializeContolsE. InitializeComponentF. There is no such method
Answer: C [page 282]
Q7. Which event is raised just before a windows form is actually closed?OO.ClosingPP. FormClosingQQ.DisposingRR. FormDisposing
Answer: B[Page 292]
Q8. What is the return type of the static method Show the MessageBox?I. intJ. ButtonStateK. DialogResultL. string
Answer: C [Page 293]
Q9. Which of the operators must be overloaded as pairs?.O. == and !=P. < and >Q. <= and >=R. + and -
Answer: A, B, C [Page 266]
Q10. Which one is implicit casting?E. double d; int a = 20; d = a;F. int a; double d=2.33; a = (int)dG. int a = Convert.ToDouble( “20.33”);H. None of the above
Answer: A [Page 270]
Q11. Which one is explicit casting?E. double d; int a = 20; d = a;F. int a; double d=2.33; a = (int)dG. int a = Convert.ToDouble( “20.33”);H. None of the above
Answer: B [Page 270]
MCQModule 1 – Introducing the programming
Chapter 18: Working with Menus and Dialog Boxes
Q1. Which one is used create Menu?SS. MainMenuTT. MenuUU. MenuStripVV. ToolStrip
Answer: C [page 294]
Q2. Which symbol you use to create a separator bar on a menu while designing a menu visually in visual studio?E. &F. *G. -H. #
Answer: C [page 296]
Q3. Which symbol you use to create a hot key on?A. &B. *C. – a menuD. #
Answer: A [page 296]
Q4. Which property of a menu item is used to show a text as tip when the user hovers the mouse over the menu item?
O. ContextMenuP. TopQ. ToolTipR. ToolText
Md. Habibul Haq BITL 15
![Page 16: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/16.jpg)
Exam/R12/Module-I/IPL
Answer: C [page 300]
Q5. What do you call the menu which is shown when users right-clock on a control?.CC. DropdownMenuDD.MenuEE. Pop-up menuFF. Properties
Answer: C [page 302]
Q6. Multiple control are not allowed to share the same context-menu? G. TrueH. False
Answer: B [page 303]
Q7. What is a “common-dialog”?SS. Some common controls that are share between two or more applicationsTT. Some common and standard dialog boxes supplied with windows OS that can be used with your own
applications UU. Some common GUI design guide linesVV. None of the above
Answer: B [Page 308, OpenDialog, SaveDialog etc]
Q8. What is the return type of the static method Show the MessageBox?M. intN. ButtonStateO. DialogResultP. string
Answer: C [Page 293]
MCQModule 1 – Introducing the programming
Chapter 19: Performing Validation
Q1. Which is the purpose data validation?WW. To ensure data is correctly processedXX. To enusure that data entered by a user matches business rulesYY. To ensure output produced by the application is in correct formatZZ. All of the above
Answer: B [page 314]
Q2. Which property indicates whether a control raises validation event or not?I. ValidationJ. ValidateK. CausesValidationL. Check
Answer: C [page 314]
Q3. Which two events do you use to validate data in a control?E. ValidateF. ValidatedG. ValidatingH. OnValidate
Answer: B, C [page 314]
Q4. What is the default value of CauseValidation?A. 0B. nullC. trueD. false
Answer: C [page 314]
Q5. The Validated occurs ________ Validating.A. BeforeB. AfterC. NoneD. All
Answer: B [page 314]
Q6. Multiple control are not allowed to share the same context-menu? I. True
Md. Habibul Haq BITL 16
![Page 17: MCQ](https://reader035.vdocuments.mx/reader035/viewer/2022082210/55cf99bd550346d0339ef29f/html5/thumbnails/17.jpg)
Exam/R12/Module-I/IPL
J. FalseAnswer: B [page 303]
Q7. What is a “common-dialog”?WW. Some common controls that are share between two or more applicationsXX. Some common and standard dialog boxes supplied with windows OS that can be used with your own
applications YY. Some common GUI design guide linesZZ. None of the above
Answer: B [Page 308, OpenDialog, SaveDialog etc]
Q8. What is the return type of the static method Show the MessageBox?Q. intR. ButtonStateS. DialogResultT. string
Answer: C [Page 293]
Md. Habibul Haq BITL 17