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 mainframe
  1. DATA STACK

  2. QUEUE

  3. COMPOUND VARIABLE

  4. SYMBOLIC VARIABLE

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

In REXX, the DATA STACK can be used for file I/O operations - you can PUSH lines to write to a file and PULL/QUEUE to read from a file. QUEUE is used for stack manipulation but not direct file I/O. COMPOUND and SYMBOLIC variables are data types, not I/O mechanisms.

Multiple choice technology mainframe
  1. EXECUTE

  2. INTERPRET

  3. RUN

  4. CALL

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

INTERPRET is the correct REXX instruction that dynamically executes a string containing REXX code. EXECUTE, RUN, and CALL are not valid REXX instructions - CALL invokes subroutines but doesn't interpret code strings. The code 'DO 3; SAY "HELLO THERE!"; END' would print the message three times.

Multiple choice technology mainframe
  1. Subroutine should start with this instruction

  2. To convert all the local variables in the subroutine as global variables

  3. To convert all the variables used in subroutine as local variables

  4. Function should start with this instrucion

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

The PROCEDURE instruction in REXX starts an internal subroutine and protects its variables by making them local to that subroutine. Without PROCEDURE, variables in a subroutine are global. PROCEDURE does not convert global variables to local - it creates a new local variable scope.

Multiple choice technology programming languages
  1. Python is faster than C

  2. Python is faster than C++

  3. Python is slower than C

  4. None of the above

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

Python is an interpreted language that translates code at runtime, while C is a compiled language that translates to machine code beforehand. This compilation step makes C significantly faster than Python for most operations.

Multiple choice technology databases
  1. get+find

  2. find

  3. find+get

  4. none of the above

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

In IDMS DMS database operations, a Fetch operation is conceptually equivalent to 'find+get'. First you find (locate) the record, then you get (retrieve) it. This two-step process characterizes the fetch operation in DMS databases. Option A has the order wrong, option B is incomplete, and option D is incorrect.

Multiple choice technology platforms and products
  1. True

  2. False

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

In vi editor, named registers (buffers) like 'a', 'b', etc. can be specified before deletion, change, yank, or put operations by prefixing the register name in double quotes. For example, 'adw' deletes a word into register 'a', and 'ap' puts contents of register 'a'. This is a core feature of vi's text manipulation system.

Multiple choice technology enterprise content management
  1. True

  2. False

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

For a REPEAT operation to execute continuously until the repeat condition becomes false (not remains true), the count parameter must be set to -1. A -1 value indicates unlimited repetition, allowing the loop to continue executing until the condition changes.

Multiple choice technology testing
  1. Stub

  2. Driver

  3. Proxy

  4. None of the above

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

To solve this question, the user needs to know about software testing and the different types of testing techniques. In particular, the user needs to understand the purpose of test drivers in software testing.

A test driver is a program that calls a software function with specific inputs and checks the return value to verify that the function behaves correctly. The purpose of the test driver is to automate the testing process and ensure that the function works as expected in different scenarios.

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

A. Driver: This option is correct. A driver is a type of test harness that is used to test a software function. It calls the function and passes it test data to verify that the function works as expected. Therefore, option A is the correct answer.

B. Stub: This option is incorrect. A stub is a type of test double that provides a simplified version of a software component for testing purposes. It is used to replace a component that is not yet available or is too complex to test. A stub is not the same as a test driver, so option B is wrong.

C. Proxy: This option is incorrect. A proxy is a type of software component that acts as an intermediary between two applications or systems. It is used to provide security, scalability, or other features. A proxy is not the same as a test driver, so option C is wrong.

D. None of the above: This option is incorrect. At least one of the options (option A) is correct, so option D cannot be the correct answer.

Therefore, the answer is: A. Driver