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
-
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.
-
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.
-
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.
-
variables with abend codes
-
variables with error code
-
only error codes
-
none of the above
B
Correct answer
Explanation
Error information passed to Java screens needs to include both the error code and associated variables to provide context for display and troubleshooting. Error codes alone are insufficient.
-
DIOJCLCK
-
DIOAPLCK
-
JCLUTLCK
-
DIOAPLCHK
B
Correct answer
Explanation
The claimed answer B (DIOAPLCK) appears to be an organization-specific JCL checker utility. Without domain knowledge of this specific organization's toolset, we rely on the marked answer. The other options (DIOJCLCK, JCLUTLCK, DIOAPLCHK) are likely distractors or similar-sounding utilities.
-
1000-EXIT
-
EXIT
-
1000_EXIT
-
BOTH a and b
A
Correct answer
Explanation
In COBOL and similar structured programming languages, paragraph names follow a specific format: numeric identifier followed by a descriptive name, with the separator being a hyphen. 1000-EXIT follows this convention correctly. Option B (EXIT) lacks the required numeric prefix, and Option C uses an underscore which is non-standard.
-
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.
-
can use automatic variables
-
can use standard rule properties
-
cannot use rule set parameters
-
cannot use custom rule
B
Correct answer
Explanation
In runtime rule selection expressions, developers can use standard rule properties like effective date, expiration date, and priority to filter rules. Automatic variables are for rule execution, not selection. Rule set parameters and custom rules can be used, contrary to what options C and D suggest.
-
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.