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 programming languages
  1. 1

  2. No difference

  3. 2

  4. 5

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

C++ structures have significant differences from C structures: they can have member functions, access specifiers (public/private/protected), constructors and destructors, support inheritance and polymorphism, and can be used as template parameters. These represent fundamental extensions beyond C's simpler struct model.

Multiple choice technology mainframe
  1. True

  2. False

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

Transparent Control Statements (TCS) in ECL indeed begin with @@. This is the defining characteristic that distinguishes them from regular ECL statements. The @@ prefix signals the ECL compiler to process these as control flow statements rather than standard code execution.

Multiple choice technology mainframe
  1. The simple PERFORM statement

  2. The PERFORM with TIMES option

  3. The PERFORM with UNTIL option

  4. The PERFORM with VARYING option

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

A simple PERFORM statement executes the target paragraph exactly once and transfers control. In contrast, the TIMES, UNTIL, and VARYING options are designed for looping, which can cause the paragraph to execute multiple times, making the simple statement the correct choice.

Multiple choice technology mainframe
  1. If statements

  2. Evaluate

  3. Perform statement

  4. Copy statement

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

In COBOL, the EVALUATE statement functions like a switch or case structure, allowing multiple alternative paths of execution based on conditions. Distractors like PERFORM, COPY, or IF statements do not match this specific definition or syntax for handling multiple branches cleanly.

Multiple choice technology packaged enterprise solutions
  1. Local variables can be passed between activities

  2. You cannot view local variables and their values in the tracer tool

  3. You cannot view the contents of the parameter page in the clipboard viewer

  4. You can view parameters and their values in the tracer tool

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

Local variables are limited to the execution scope of a single activity and cannot be passed between different activities. The other statements are true: local variables cannot be traced in Tracer, and parameter pages are not visible in the clipboard viewer, making the first statement the false one.

Multiple choice technology
  1. Voids

  2. Records

  3. Vectors

  4. Unions

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

Voids represent the absence of a value or return type, not a compound data structure. Records, Vectors, and Unions are all compound types that can contain multiple elements or fields, while Void is a primitive/atomic concept.

Multiple choice technology
  1. At Compile time

  2. At Run time

  3. At Both compile time and run time

  4. Never

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

Job parameters in DataStage are set at runtime when executing a job. This allows flexibility to control job behavior dynamically without modifying the job design. Compile time is incorrect because parameter values are not fixed during compilation.

Multiple choice technology
  1. True

  2. False

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

In Ab Initio graphs, a formal parameter is a parameter defined in a graph parameter that can be overridden or overwritten by the user when the graph is executed. This allows for flexible configuration without modifying the graph itself. Actual parameters are the values passed in, while formal parameters are the placeholders that accept them.

Multiple choice technology
  1. Abort on first reject

  2. Never abort

  3. Abort on predefiend event

  4. Use limit/ramp

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

In Ab Initio components with reject handling (like Rollup or Join), the defined reject tolerances are 'Abort on first reject', 'Never abort', and 'Use limit/ramp'. 'Abort on predefined event' is NOT a standard reject tolerance option in Ab Initio components. Note: The option has a typo ('predefiend' instead of 'predefined'), but this doesn't change the answer - the option itself doesn't exist as a standard tolerance.

Multiple choice technology programming languages
  1. 1001

  2. error

  3. Head First JavaScript

  4. id

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

The Book constructor function creates objects with id and name properties using 'this'. When called with 'new Book("1001", "Head First JavaScript")', it creates an object where book.id = "1001" and book.name = "Head First JavaScript". The alert(book.id) correctly outputs "1001". Option B (error) is wrong because this is valid constructor syntax.

Multiple choice technology testing
  1. Option Declare

  2. Option Explicit

  3. Option Mandate

  4. None

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

Using Option Explicit at the start of a VBScript file forces the developer to declare all variables before using them, preventing typos and bugs. Statements like Option Declare and Option Mandate do not exist in VBScript syntax, making them incorrect distractors.