Computer Knowledge

Programming Fundamentals

2,381 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. 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

Multiple choice technology programming languages
  1. No

  2. Case sensitivity is compiler-determined

  3. Yes

  4. None of the Above

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

This question lacks context, but C++ is a strictly case-sensitive programming language. Therefore, identifiers like myVar and myvar are treated as completely distinct.

Multiple choice technology programming languages
  1. True

  2. False

  3. It depends on the variable type

  4. None of the Above

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

This question lacks context, but in C++, whether a variable is automatically initialized or contains garbage values depends on its type and storage duration (e.g., global/static variables are zero-initialized, while local automatic variables are not).

Multiple choice technology programming languages
  1. The snippet is illegal

  2. It loops forever

  3. It is ignored by compiler, but it is not illegal

  4. None of the Above

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

This question lacks context, but like question 135521, it refers to an infinite loop construct (such as while(true) or for(;;)), which is syntactically legal and loops forever.

Multiple choice technology programming languages
  1. Breaks out of the if statement

  2. Exits the function

  3. Nothing (Compiler error)

  4. None of the Above

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

This question lacks context, but in C++, using a break statement outside of a loop or a switch block (such as directly inside an if statement) results in a compilation error.