Computer Knowledge
Programming Fundamentals
2,381 Questions
Programming fundamentals form the core logic of software development and computer science. This includes variable declarations, pointer assignments, loop iterations, and exception handling. These technical topics are regularly tested in computer knowledge and IT officer competitive examinations.
Variables and arraysPointer assignmentsLoop iterationsException handling blocksCompile time errorsFunction references
Programming Fundamentals Questions
-
to_date(string,format)
-
to_char(date,format)
-
to_date(date,format)
-
to_number(string,format)
B
Correct answer
Explanation
The to_char function converts a date value to a string representation in the specified format. Option B is the correct PostgreSQL and Oracle function. Option A (to_date) converts string to date, option C is an invalid signature, and option D converts strings to numbers, not dates to strings.
-
r_frozen_flag
-
r_has_frzn_assembly
-
both
-
none
A
Correct answer
Explanation
In Documentum, the r_frozen_flag attribute is set to true (1) to indicate that a sysobject or assembly has been explicitly frozen. r_has_frzn_assembly indicates containing frozen components rather than the object itself being frozen.
-
r_frozen_flag
-
r_has_frzn_assembly
-
both
-
none
A
Correct answer
Explanation
The r_frozen_flag attribute is set to true when an object is explicitly frozen using the freeze() method, indicating it's now immutable. The r_has_frzn_assembly attribute indicates frozen assembly membership but is not the direct flag for individual object freeze status.
-
r_frozen_flag
-
r_has_frzn_assembly
-
both
-
none
A
Correct answer
Explanation
The r_frozen_flag attribute is set to true when an object is explicitly frozen using the freeze() method, indicating it's now immutable. The r_has_frzn_assembly attribute indicates frozen assembly membership but is not the direct flag for individual object freeze status.
-
Function Generator
-
Step Factory
-
Function Factory
-
None
B
Correct answer
Explanation
In QTP/UFT, the Step Generator (sometimes called Step Factory in documentation) is the feature used to construct test steps by selecting operations on test objects. Function Generator is used for inserting functions, not constructing steps with object operations.
-
Option Declare
-
Option Explicit
-
Option Mandate
-
None
B
Correct answer
Explanation
Option Explicit is the VBScript statement that forces explicit declaration of all variables before use. This helps catch typos and undeclared variable errors at runtime, improving code reliability and debugging.
A
Correct answer
Explanation
VBScript is a variant-type language where all variables are of type Variant and can hold any data type. You cannot declare variables with specific data types like Integer, String, or Boolean - the Variant type adapts automatically.
B
Correct answer
Explanation
VBScript is not case-sensitive. Variable names, keywords, and function names can be written in any combination of uppercase and lowercase letters - the interpreter treats them as identical.
-
2
-
1
-
3
-
No index is required for referencing an element in a 2D array. Index is applicable only for 1D arrays.
A
Correct answer
Explanation
A 2-dimensional array requires exactly 2 indices - one for the row and one for the column. Each index specifies a position along one of the dimensions. Option D is incorrect because 2D arrays definitely need indices; option B (1 index) is for 1D arrays, and option C (3 indices) would be for 3D arrays.
-
While … Wend
-
Do While … Loop
-
Do Until … Loop
-
VB Script doesn't have any deprecated loops at all.
A
Correct answer
Explanation
In VBScript, While ... Wend is considered obsolete and deprecated in favor of the more flexible Do ... Loop structures. The language reference recommends avoiding While ... Wend in modern scripts.
B
Correct answer
Explanation
A conventional For loop using an index counter can iterate through collections by index (e.g., using Item(i) or id(i)), so a For Each loop is not strictly mandatory, making the statement false.
B
Correct answer
Explanation
This statement is false. In VBScript, Functions return values but Subroutines do not. Subroutines perform actions without returning a value to the caller, while Functions are designed specifically to return values. The statement reverses the actual behavior.
A
Correct answer
Explanation
GETCURSOR is a statement in SAP ABAP used to capture the field value and position when a user double-clicks on a field in a list (ALV or basic list). It stores the field name, value, and line number, allowing the program to trace which specific data element was interacted with. This is commonly used for drill-down functionality and interactive reporting.
B
Correct answer
Explanation
In ABAP, internal tables passed using the TABLES parameter are passed by reference (address), not by value and result. The TABLES keyword creates a reference to the original internal table, so any changes made within the subroutine directly affect the calling program's table. Value and result would mean copying the entire table structure on both entry and exit, which would be inefficient for large internal tables.
-
CASE
-
ISNULL
-
ISNUMERIC
-
ISDATE
-
None
D
Correct answer
Explanation
A deterministic function always returns the same result for the same input. Non-deterministic functions can return different results. ISDATE is non-deterministic because its behavior depends on session settings like DATEFORMAT and LANGUAGE - the same string might be interpreted differently. CASE, ISNULL, and ISNUMERIC are deterministic functions.