Computer Knowledge
Programming Fundamentals
2,611 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
-
It produces the output Procedure B calling C
-
It produces the output Procedure C calling B
-
It produces a compilation error because procedure C requires a forward declaration
-
It produces a compilation error because procedure B requires a forward declaration.
C
Correct answer
Explanation
In PL/SQL packages, procedures must be declared before they can be called by other procedures in the same package specification or body. If procedure B calls procedure C, and C is defined after B in the package body without a forward declaration, the compiler cannot resolve the reference to C when compiling B.
B
Correct answer
Explanation
The Informatica transformation language has reserved keywords that cannot be used as identifiers. TRUE, AND, and NULL are all reserved keywords with specific meanings. SUCCESS is not part of the reserved keyword set - it can be used as a user-defined variable name or column alias without conflict. This distinction matters when naming transformation ports or variables.
B
Correct answer
Explanation
In most programming languages, method overloading is based on the method name and its parameter list (signature). Functions cannot be overloaded if they only differ by their return type because the compiler cannot determine which function to call based on usage.
C
Correct answer
Explanation
The 'Is' keyword in VB.NET is used for object reference comparison. It checks if two object variables refer to the same instance in memory. 'And' and 'Or' are logical operators, while 'Of' is used for generic type parameters.
A
Correct answer
Explanation
In VB.NET, all arrays are zero-based by default, meaning the first element is at index 0. This matches the array indexing in most modern programming languages.
A
Correct answer
Explanation
In VB.NET, all arrays are zero-based by default, meaning the first element is at index 0. This matches the array indexing in most modern programming languages.
C
Correct answer
Explanation
The IS keyword in VB.NET is used for object reference comparison. It checks whether two object variables refer to the exact same object instance in memory, not whether their contents are equal.
B
Correct answer
Explanation
The statement 'OPTION exists in VB.NET' is false. While VB.NET has Option Strict, Option Explicit, and Option Compare statements, there is no single 'OPTION' statement by itself.
D
Correct answer
Explanation
In SAP BusinessObjects, the If() function is used to conditionally format or display rows in a block (i) and to display dynamically grouped values (iii). Scheduled reports (ii) and dynamic lists of values (iv) are managed through query filters and scheduling options rather than the If() function. The option text uses 'a & c' to represent 'i & iii'.
-
a program must always begin with a PROCEDURE statement and end with an END statement
-
PL/I instructions can be coded between positions 1 and 72
-
you have to declare each variable that you are going to use
-
a program can be composed out of different procedures
-
comment lines have to be preceded by //
A,D
Correct answer
Explanation
PL/I programs must begin with a PROCEDURE statement and end with an END statement as structural requirements. The language supports modular programming by allowing programs to be composed of multiple procedures. Claims about column limits and mandatory variable declarations are incorrect, and PL/I uses /* */ for comments, not //.
-
REPEAT 5 TIMES;instruction;END;
-
DO J=1 TO 5;instruction;END;
-
COUNTER = 1;DO WHILE COUNTER < 5;COUNTER = COUNTER + 1;instruction;END;
-
REPEAT VARYING COUNTER FROM 1 BY 1 UNTIL COUNTER = 5;instruction;END;
B
Correct answer
Explanation
PL/I uses the DO loop construct for iteration control. The correct syntax for repeating an instruction 5 times is DO J=1 TO 5; instruction; END; which creates a controlled loop with an index variable. The REPEAT keyword doesn't exist in PL/I, and the WHILE option would require different initialization and would execute only 4 times with < 5 condition.
-
after each declaration of a variable
-
at the end of each instruction
-
to end a DO instruction
-
at the end of the program
-
to end an IF instruction
B,D,E
Correct answer
Explanation
In PL/I, semicolons terminate statements rather than acting as separators. Thus, a semicolon is required at the end of each statement (instruction), to terminate groups like DO, and to terminate the program block. However, the options listed are slightly confusing as a DO instruction ends with a separate END statement, which contains a semicolon, but 'at the end of each instruction', 'at the end of the program', and 'to end an IF instruction' (which is terminated by a semicolon) align with PL/I statement terminator rules.