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

Multiple choice technology testing
  1. A. Dim statement

  2. B. Con statement

  3. C. Const statement

  4. D. Option Explicit statement

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In VBScript, constants are declared using the Const statement (e.g., Const PI = 3.14). Dim is for variables, Con is not a valid statement, and Option Explicit forces variable declaration but doesn't define constants. Once assigned, constants cannot be modified during script execution.

Multiple choice technology mainframe
  1. DFHEIBDK, DFHCOMMAREA

  2. DFHEIBLK, DFHCOMNAREA

  3. DFHEEBLK, DFHCOMMAREA

  4. DFHEIBLK, DFHCOMMAREA

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

When a CICS program is compiled, the precompiler includes DFHEIBLK (Execute Interface Block) and DFHCOMMAREA (Communication Area) code. DFHEIBLK contains control information and parameter passing data, while DFHCOMMAREA is used for data communication between transactions.

Multiple choice technology programming languages
  1. TYPRUN=COMPILE

  2. TYPRUN=ERRFREE

  3. TYPRUN=HOLD

  4. TYPRUN=SCAN

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

TYPRUN=SCAN checks JCL syntax for errors without actually executing the job. It's useful for validation. TYPRUN=COMPILE compiles a program but doesn't execute. TYPRUN=HOLD holds the job. TYPRUN=ERRFREE isn't valid (you might be thinking of a compiler option). SCAN is the only one that purely checks for errors without execution.

Multiple choice technology programming languages
  1. INPUT

  2. PARM

  3. SYSOUT

  4. COND

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

PARM is the EXEC statement parameter used to pass data or parameters directly to the invoked program. INPUT is not a valid JCL keyword. SYSOUT specifies a sysout class for output, and COND sets job step conditional execution logic. The PARM field allows programs like COBOL to receive runtime parameters up to 100 characters.

Multiple choice technology programming languages
  1. Specifies that any variable name is declared (with type) before use

  2. Specifies whether String should be compared as binary

  3. Specifies that variables should be intialized before use

  4. All of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

To understand the significance of the option explicit statement when it is set to ON, the user needs to know about the Option Explicit statement in Visual Basic for Applications (VBA) programming language.

The Option Explicit statement is used to explicitly declare all variables in a VBA code module. When Option Explicit is turned on, the user must declare all variables before they are used in the code. If a variable is not declared, VBA generates a compile-time error.

Now let's go through each option and explain why it is right or wrong:

A. Specifies that any variable name is declared (with type) before use - This option is correct. When Option Explicit is turned on, it requires you to declare all variables before they are used in the code. This helps prevent errors and ensures that all variables have a defined type.

B. Specifies whether String should be compared as binary - This option is incorrect. The Option Compare statement is used to specify how VBA compares strings, not the Option Explicit statement.

C. Specifies that variables should be initialized before use - This option is incorrect. Option Explicit only requires variables to be declared before use, not initialized.

D. All of the above - This option is incorrect. Option Explicit only specifies that variables must be declared before use, not any of the other options listed.

Therefore, the correct answer is:

The Answer is: A

Multiple choice technology programming languages
  1. open cursor; ---some statements close;

  2. open cursor; fetch into variables; ---some statements close cursor;

  3. open cursor; fetch into variables; ---some statements close;

  4. All of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A standard explicit cursor lifecycle in PL/SQL involves opening the cursor, fetching the rows into variables within a loop, and closing the cursor. The correct option accurately reflects this sequence.