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
-
Not Declared explicitly
-
Raised implicitly when a predefined Oracle error occurs
-
caught by referencing the standard name within an exception-handling routine
-
All of the above
-
None of the above
D
Correct answer
Explanation
Named system exceptions in PL/SQL (like NO_DATA_FOUND, TOO_MANY_ROWS, DUP_VAL_ON_INDEX) are predefined exceptions that don't require explicit declaration, are raised automatically when specific Oracle errors occur, and are caught by referencing their standard names in exception handlers. These are built into the PL/SQL language for common error conditions.
A
Correct answer
Explanation
Pragma EXCEPTION_INIT is used to associate a user-defined exception name with a specific internal Oracle error number (ORA-nnnnn). This allows the programmer to write an explicit 'WHEN' handler for an error that doesn't have a pre-defined name in PL/SQL.
-
DECLARE
-
RAISE
-
PRAGMA
-
INITIATE
B
Correct answer
Explanation
In PL/SQL, user-defined exceptions must be explicitly raised using the RAISE statement when the error condition occurs. Unlike predefined exceptions that are raised automatically by Oracle, your custom exceptions need manual triggering with RAISE exception_name;. This allows controlled error handling for application-specific conditions.
-
Hardware failures
-
Design faults
-
Coding mistakes
-
None of the above
-
All of the above
E
Correct answer
Explanation
Run-time errors can originate from multiple sources including hardware failures (disk crashes, memory errors), design faults (logic errors, incorrect requirements interpretation), and coding mistakes (syntax errors, boundary violations). The most comprehensive answer recognizes that all these categories contribute to run-time error conditions.
B
Correct answer
Explanation
In PL/SQL, exceptions have scope similar to variables. You can declare an exception with the same name in two different blocks (nested or separate). The exception declared in the inner block will hide the one in the outer block, or they will simply exist independently in their respective scopes.
-
ISNULL(@variable,'5')
-
NULLIF(@variable,'5')
-
COALESCE(@variable,'5')
-
NONNULL(@variable,'5')
A,C
Correct answer
Explanation
ISNULL(@variable,'5') returns '5' when @variable is NULL, otherwise returns @variable itself. COALESCE(@variable,'5') does the same by returning the first non-NULL value from its arguments. NULLIF returns NULL if two values are equal - the opposite behavior needed here, and NONNULL is not a valid SQL function.
-
Events
-
Value Set
-
Lookup Type
-
None of the Above
C
Correct answer
Explanation
In Oracle Workflow, a Lookup Type defines a list of possible values that can be referenced by messages, notifications, functions, or processes as their potential result types. It acts as a constrained set of valid outcomes for workflow components. Value Sets are different (they define valid values for parameters), and Events are workflow occurrences, not result type lists.
-
/BEFORE
-
/EXPRIED
-
all of the above
-
none of the above
C
Correct answer
Explanation
This question tests knowledge of VMS APPEND command qualifier compatibility rules. In VMS, the /CREATED qualifier (used with /MODIFIED, /BEFORE, /AFTER) has specific incompatibility rules. The /CREATED qualifier is incompatible with time-based selection qualifiers when used in certain combinations, and the question is designed to test that specific knowledge.
B
Correct answer
Explanation
In VMS DCL, the CALL command can pass up to 8 parameters to a subroutine. This is a built-in limitation of the CALL command syntax in VMS, which is important knowledge for writing DCL procedures that use subroutines.
-
strings
-
integers
-
floating point
-
booleans
C
Correct answer
Explanation
DCL supports strings, integers, and booleans natively. Floating-point numbers are not directly supported and require special handling or external commands for mathematical operations.
-
NULLIF(X,Y)
-
COALESCE(X,Y)
-
ZEROIFNULL(X,Y)
-
NULLIFZERO(X,Y)
A
Correct answer
Explanation
The NULLIF(X, Y) function compares two expressions. If they are equal, the function returns NULL. If they are not equal, it returns the first expression (X). COALESCE returns the first non-null value in its list.
-
STOP RUN is the last executable statement of the main program. It returns control back to OS.
-
EXIT PROGRAM is the last executable statement of sub-program. It returns control back to main program.
-
GOBACK can be coded in main program as well as sub-program as the last statement. It just gives the control back from where it received the control.
-
None of the above.
A,B,C
Correct answer
Explanation
In COBOL, STOP RUN terminates the run unit and returns control to the OS. EXIT PROGRAM is used in a subprogram to return control to the calling program. GOBACK can be used in both and returns control to the caller. Thus, all three statements are correct.
-
One Value
-
More than One Value
-
No Value
-
User Defined Function will not return Value
-
JOB Statement
-
EXEC Statement
-
NONE
-
Both JOB and EXEC statement
D
Correct answer
Explanation
The COND parameter in JCL is used to test return codes from previous steps and control job/step execution based on those conditions. It can be specified on both JOB statements (to control execution of the entire job) and EXEC statements (to control individual job steps).
A
Correct answer
Explanation
COBOL was designed to be highly readable and English-like, using verbose syntax and descriptive names. This design philosophy makes COBOL programs self-documenting, meaning the code itself is easy to read and understand without extensive external documentation.