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. True

  2. False

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

VBScript supports only a single data type called Variant, which can contain different types of information depending on how it is used. Because of this, you cannot declare a variable of a specific type like Integer or String. This makes the statement true, rendering the false option incorrect.

Multiple choice technology programming languages
  1. do i=1 to dim(tmp);

  2. do i=1 to dim(*);

  3. do i=1,2,3,4;

  4. do i=1 to 4;

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

The dim function in SAS requires a valid array name as its argument to return the number of elements. Using dim(*) is syntactically invalid and causes an error. In contrast, dim(tmp), a list of explicit indices 1,2,3,4, or the range 1 to 4 correctly reference all four array elements.

Multiple choice technology programming languages
  1. can be used to manipulate character strings in macro variable values.

  2. have the same basic syntax as the corresponding DATA step functions and yield similar results.

  3. all of the above

  4. none of the above

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

Macro character functions in SAS can manipulate character strings in macro variables and share the same syntax as corresponding DATA step functions, yielding similar results. The 'all of the above' option correctly encompasses both characteristics.

Multiple choice technology testing
  1. Unreachable Code

  2. Undeclared Variables

  3. Faults in requirements

  4. Too few comments

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

Static analysis tools examine source code without running it, allowing them to detect structural issues like unreachable code, undeclared variables, or insufficient comments. However, they cannot evaluate whether the program meets business needs, meaning faults in requirements can only be identified through dynamic testing or manual reviews.

Multiple choice technology packaged enterprise solutions
  1. Assign-WorkList

  2. Assign-WorkBasket

  3. Either

  4. None

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

An assignment in Pega is an instance of either the Assign-Worklist class (when assigned to an individual operator) or the Assign-Workbasket class (when assigned to a work queue/basket). Therefore, 'Either' is correct.

Multiple choice technology packaged enterprise solutions
  1. A rule used to validate that the data entered in a field is an integer.

  2. A rule used to ensure that all interested persons are apprised of a work object’s status

  3. A rule used to ensure that all required fields are complete.

  4. A rule used to validate that a user has the appropriate security to access a part of the application

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

A Validation rule in Pega is primarily used to ensure that all required fields are complete and that data meets specified criteria. It does not validate data types (that's done by edit validates), check security permissions, or notify interested parties (that's done by routing).

Multiple choice technology programming languages
  1. when arrays and references are passed

  2. only when references are passed

  3. args are not changed

  4. Command line args are changed

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

@, the default array for subroutine arguments, contains aliases to the actual passed elements. When arrays or references are passed, modifying @ changes the original data. For references, this affects the referenced object.

Multiple choice technology programming languages
  1. 1 can only be called with predecleration of complex_num

  2. 1 and 2 are same

  3. 2 can only be called with predecleration of complex_num

  4. 1 is reference to a subroutine

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

In Perl, calling a subroutine without the ampersand sigil requires a pre-declaration (or prior definition) to let the compiler parse it properly, whereas using the ampersand allows calling it without such declarations. Therefore, the second syntax relies on pre-declaration, making this option correct.

Multiple choice technology mainframe
  1. APCT

  2. ASRB

  3. AICA

  4. ABMB

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

AICA is the CICS abend code indicating a task exceeded its maximum execution time, typically caused by an infinite loop or runaway process. APCT indicates a program check exception, ASRB is a storage violation, and ABMB is a mapping error. CICS uses AICA to protect system resources by terminating tasks that run too long.