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

  2. else

  3. finally

  4. if

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

The if and else keywords are used for conditional branching in Java - if executes code when a condition is true, else handles the false case. catch and finally are part of exception handling (try-catch-finally blocks), not conditional flow control.

Multiple choice technology programming languages
  1. To create a mutable string

  2. To store a single character

  3. To store multiple items of the same type

  4. none

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

An array is a data structure used to store a fixed-size, sequential collection of multiple items of the same data type. A single character is stored in a primitive char variable, and mutable strings are handled by classes like StringBuilder or StringBuffer in Java.

Multiple choice technology packaged enterprise solutions
  1. a runtime error

  2. No error is displayed

  3. a compile time error

  4. Only warning message is displayed

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

FieldDefault PeopleCode executes during runtime processing, not during compilation. If an error occurs in FieldDefault logic, it manifests as a runtime error when the code executes. Compile-time errors occur when PeopleCode is saved/compiled, not when FieldDefault logic runs.

Multiple choice technology programming languages
  1. REASSIGN

  2. REDECLARE

  3. REDEFINE

  4. None of the above

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

In languages like Software AG's Natural or COBOL (with REDEFINES), the REDEFINE statement is used to refine or restructure already declared variables or memory fields. This allows programmers to map new structures or different data types to the same physical memory space.

Multiple choice technology programming languages
  1. char* text;

  2. char *text;

  3. Char * text;

  4. char text*;

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

char* text; follows the project's pointer declaration guideline - the asterisk is attached to the type, not the variable name. The alternative char *text places space between type and asterisk, which this project's guidelines specify as incorrect.

Multiple choice technology programming languages
  1. True

  2. False

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

REXX is an interpreted language, not a compiled one. The REXX interpreter reads and executes the source code directly without a compilation step. This is a key feature of REXX - you can write and test code immediately without waiting for compilation. Compiled languages like COBOL or PL/I require a compilation step to produce object code before execution. The statement that REXX requires compilation is false.

Multiple choice technology programming languages
  1. PARSE

  2. PULL

  3. PUSH

  4. STRING

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

The PARSE instruction in REXX is specifically designed for string manipulation and parsing. It can break strings into multiple variables using various templates (like PARSE VAR, PARSE VALUE, PARSE LINE, PARSE UPPER). The PARSE instruction with the 'X' suffix (like PARSE 'ABC'X) converts hexadecimal to character strings. Options B and C (PULL, PUSH) are stack operations, and STRING is not a REXX keyword.

Multiple choice technology programming languages
  1. Top of stack

  2. Bottom of stack

  3. Middle of stack

  4. None of the above

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

The PUSH instruction in REXX places data onto the top of the external data stack. This is a Last-In-First-Out (LIFO) structure where PUSH adds elements to the top, and PULL retrieves from the top. The stack grows upward, so new items are always placed 'on top' of existing items. Option B (bottom) and C (middle) are incorrect because PUSH always operates on the top of the stack.

Multiple choice technology programming languages
  1. EXPOSE

  2. INTERPRET

  3. TRACE

  4. DEBUG

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

The TRACE instruction in REXX is used for interactive debugging and program execution tracing. When TRACE is enabled (with options like TRACE ALL, TRACE RESULTS, TRACE INTERMEDIATE), REXX displays each instruction before execution and/or shows intermediate results, making it easier to debug logic errors and trace program flow. DEBUG is not a REXX keyword, and EXPOSE/INTERPRET serve other purposes.

Multiple choice technology databases
  1. Functions always return the same result any time they are called with a specific set of input values.

  2. Functions may return different results each time they are called with a specific set of input values

  3. None

  4. Both of Them

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

Deterministic functions always return the identical result given the same set of input values and database state. Non-deterministic functions (like GETDATE() or RAND()) can return different values on subsequent invocations with the same parameters.