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
-
method
-
function
-
statement
-
operator
D
Correct answer
Explanation
void is a unary operator in JavaScript that evaluates its expression and returns undefined. It is not a method, function, or statement - it's specifically an operator used when you want to execute a side effect without returning a value.
-
variables with abend codes
-
only error codes
-
variables with error code
-
none of the above
C
Correct answer
Explanation
Error screens in Java applications need to display both the variables involved and the error code to enable debugging and troubleshooting. Variables provide context about what failed, while error codes identify the specific failure type.
-
DIOAPLCK
-
DIOJCLCK
-
JCLUTLCK
-
DIOAPLCHK
A
Correct answer
Explanation
In specific mainframe training environments, DIOAPLCK is the recognized JCL checker utility used to validate JCL syntax and identify errors before execution. The other options are invalid variations or distractors of this specific command name used in the utility context.
-
EXIT
-
1000-EXIT
-
1000_EXIT
-
BOTH 1 and 2
B
Correct answer
Explanation
1000-EXIT is the standard paragraph name for EXIT paragraphs in COBOL programs. The numbering convention (1000) places it at the end, and the hyphenated format is standard COBOL paragraph naming.
-
enumeration
-
iteration
-
culmination
-
pass through
B
Correct answer
Explanation
Each pass through a loop is called an iteration. This is standard programming terminology used across all languages. Enumeration refers to listing items, culmination is an ending point, and 'pass through' is not the technical term.
-
for
-
while
-
do-while
-
no looping process checks the test condition at the end
C
Correct answer
Explanation
The do-while loop checks the test condition at the end of the loop, after executing the loop body. This guarantees the loop executes at least once. The 'for' and 'while' loops check conditions at the beginning.
-
the next iteration of the loop
-
the first statement after the loop
-
the statement following the continue statement
-
the return 0; statement
A
Correct answer
Explanation
A continue statement causes the program to skip the remaining statements in the current iteration and jump to the next iteration of the loop. It does not exit the loop (that would be break), and it does not skip to the statement following continue.
-
parentheses ( )
-
braces { }
-
brackets [ ]
-
arrows < >
B
Correct answer
Explanation
In C/C++/Java, when a for loop contains multiple statements in its body, you must enclose them in curly braces { } to form a block. Without braces, only the first statement would be part of the loop, and the rest would execute once after the loop completes.
-
enumeration
-
iteration
-
culmination
-
pass through
B
Correct answer
Explanation
In computer programming, a single execution of the set of instructions contained within a loop is universally defined as an iteration. Terms like enumeration, culmination, or pass through do not serve as the standard computer science definition.
-
for
-
while
-
do-while
-
no looping process checks the test condition at the end
C
Correct answer
Explanation
The do-while loop is unique in that it checks the test condition at the end of each iteration. This guarantees the loop body executes at least once, even if the condition is initially false. For and while loops check conditions at the start.
-
the return 0; statement
-
the first statement after the loop
-
the statement following the continue statement
-
the next iteration of the loop
D
Correct answer
Explanation
When a continue statement is encountered within a loop, it immediately skips the remaining statements in the current iteration and jumps to the next iteration of the loop. Unlike break, which exits the loop entirely, continue just restarts the loop cycle.
-
NEW_TIME
-
Decode
-
ROWIDTOCHAR
-
SQRT
B
Correct answer
Explanation
The DECODE function in SQL works like an IF-THEN-ELSE statement by evaluating values and returning different results based on conditions. It takes an expression and pairs of search-result values, with an optional default.
-
main task only
-
any task in rule flow
-
rule tasks and functions
-
sub flow task
B
Correct answer
Explanation
Initial actions in IBM ODM rule flow can be defined in any task, not just the main task, allowing flexible setup logic throughout the flow. These actions execute before the main task logic. Sub flow tasks and rule tasks/functions are not the correct scope for defining initial actions.
-
rule subsumptions
-
rule with no actions
-
infinitely looping
-
self inconsistent
C
Correct answer
Explanation
The rule consistency checker in IBM ODM cannot detect infinitely looping rules because infinite loops are a runtime behavior that depends on input data and execution context. It can detect rule subsumptions, rules with no actions, and self-inconsistent rules through static analysis.
-
specifies a listof values
-
specifiesa list of references
-
Both
-
None
A
Correct answer
Explanation
The 'Literal' ordering property of a rule task in IBM ODM specifies an explicit list of values that determine rule execution order. It is not about references to other objects. This allows precise control over rule sequence when the default ordering is not suitable.