1. Even if we define a function in a class, then also we need to declare it first_____
- a) TRUE
- b) FALSE
- c) N.A.
- d) N.A.
Answer: B - In C++, function definitions within a class serve as both declaration and definition, so separate declaration is not necessary.
2. Constructors has return type void ?
- a) TRUE
- b) FALSE
- c) N.A.
- d) N.A.
Answer: B - Constructors in C++ do not have any return type, not even void.
3. The major goal of inheritance in C++ is ?
- a) To facilitate the reusability of code
- b) To help modular programming
- c) To facilitate the conversion of data types
- d) To extend the capabilities of a class
Answer: A - The primary purpose of inheritance is code reusability, allowing new classes to reuse properties and behaviors of existing classes.
4. Data members and member functions are enclosed within ?
- a) union
- b) structure
- c) class
- d) array
Answer: C - Classes encapsulate both data members (variables) and member functions (methods) in object-oriented programming.
5. What is the output of this strict equality operator? 5 === '5'
- a) TRUE
- b) FALSE
- c) N.A.
- d) N.A.
Answer: B - Strict equality (===) in JavaScript checks both value and type. 5 (number) is not equal to '5' (string).
6. Which of the following javascript functions are used to convert nonnumeric values into numbers?
- a) Number()
- b) parseFloat()
- c) parseInt()
- d) All of the above
Answer: D - All three functions can convert non-numeric values to numbers: Number() for general conversion, parseFloat() for floating-point, and parseInt() for integers.
7. ________ returns true if a variable is an array, if not false.
- a) Array.isArray()
- b) Array.from()
- c) Array.of()
- d) Array.observe()
Answer: A - Array.isArray() is the built-in JavaScript method specifically designed to check if a variable is an array.
8. The function definitions in JavaScript begins with_____
- a) Identifier and Parentheses
- b) Return type and Identifier
- c) Return type, Function keyword, Identifier and Parentheses
- d) Identifier and Return type
Answer: A - JavaScript function definitions start with the function keyword, followed by an identifier and parentheses containing parameters.
9. Which is true about the name and text property of a control?
- a) They are the same when the control is first created.
- b) The text property changes to match any changes in the name property.
- c) The name property changes to match any changes in the text property.
- d) They are never the same unless the programmer makes it that way.
Answer: A - In many development environments, when a control is created, its Name and Text properties initially have the same value.
10. Which VBScript function can compare two strings?
- a) StringCompare
- b) Compare
- c) StrComp
- d) StrCompare
Answer: C - StrComp() is the VBScript function used to compare two strings, returning values based on their relative order.
11. Which of the following is used to get error details in VBScript?
- a) Err.Number
- b) Err.Description
- c) Both of the above.
- d) None of the above.
Answer: C - Both Err.Number (error code) and Err.Description (error message) provide details about errors in VBScript.
12. Expression C = i++ causes_____
- a) Value of i assigned to C and then i incremented by 1
- b) i to be incremented by 1 and then value of i assigned to C
- c) Value of i assigned to C
- d) i to be incremented by 1
Answer: A - The post-increment operator (i++) first returns the current value of i (assigned to C), then increments i by 1.
13. Which of the following are the ways to create a Javascript Object?
- a) var obj = {};
- b) var obj = Object.create();
- c) var obj = new Object();
- d) All of the above
Answer: D - JavaScript provides multiple ways to create objects: object literals {}, Object.create(), and the new Object() constructor.
14. Which NameSpace is used to access the metadata in an Assembly?
- a) System.Assembler
- b) System.Reflection
- c) System.IO
- d) System.XML
Answer: B - System.Reflection namespace in .NET provides classes to examine assembly metadata, types, and members at runtime.
15. Which of the following is true about cookie handling in VBScript?
- a) VBScript can manipulate cookies using the cookie property of the Document object
- b) VBScript can read, create, modify, and delete the cookie or cookies that apply to the current web page.
- c) Both of the above.
- d) None of the above.
Answer: C - VBScript can handle cookies through the Document.cookie property, allowing full CRUD (Create, Read, Update, Delete) operations.
16. Which of the following keywords are used to control access to a class member?
- a) protected
- b) switch
- c) goto
- d) for
Answer: A - 'protected' is an access modifier that restricts member access to the class itself and derived classes.
17. Why JavaScript is called as Lightweight Programming Language?
- a) because JS can provide programming functionality inside but up to certain extend.
- b) because JS is available free of cost.
- c) because we can add programming functionality inside JS
- d) because JS is client side scripting
Answer: A - JavaScript is considered lightweight because it provides essential programming features without the complexity of full-scale languages like Java or C++.
18. Which of the following is a server-side JavaScript object?
- a) FileUpLoad
- b) File
- c) Function
- d) Date
Answer: B - The File object is specific to server-side JavaScript environments (like Node.js) for file system operations.
19. Which is not a property of the Common control class?
- a) Show
- b) BackColor
- c) Font
- d) ForeColor
Answer: A - 'Show' is typically a method (like Show() or Hide()) rather than a property. Properties include BackColor, Font, and ForeColor.
20. Which of the following statements creates an object in VBScript?
- a) Set obj = CreateObject('Scripting.Dictionary')
- b) Dim obj = new Scripting.Dictionary
- c) Both of the above.
- d) None of the above.
Answer: A - VBScript uses the Set keyword with CreateObject() function to instantiate COM objects.