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. checks for the syntax error and will hold the job

  2. checks for the syntax error

  3. will hold the Job

  4. will hold the job and after the job is released it wil check for the syntax error

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

TYPRUN=JCLHOLD is a JCL parameter that holds the job without executing it initially. Once the job is released from hold, THEN the system checks for syntax errors before execution. This is different from TYPRUN=SCAN which only checks syntax without holding.

Multiple choice technology
  1. -(void)setPrice:(float)newPrice;

  2. -(void)setPrice:float newPrice;

  3. -void setPrice:(float)newPrice;

  4. -void setPrice:float newPrice;

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

Objective-C method declarations require the return type in parentheses after the minus sign. The correct syntax is -(returnType)methodName:(parameterType)parameterName;

Multiple choice technology testing
  1. lr_output_message

  2. lr_debug_message

  3. lrd_stmt

  4. lrd_fetch

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

To answer this question, the user needs to have knowledge of the functions in LoadRunner that can send messages to the output window.

Option A: lr_output_message - This function sends a message to the LoadRunner output window during script execution. This option is correct.

Option B: lr_debug_message - This function sends a debug message to the LoadRunner output window during script execution. This option is incorrect as it sends a debug message and not a regular message to the output window.

Option C: lrd_stmt - This function is used to execute SQL statements for ODBC and Oracle databases. It does not send a message to the output window. This option is incorrect.

Option D: lrd_fetch - This function retrieves data that matches the criteria specified in the SQL statement. It does not send a message to the output window. This option is incorrect.

Therefore, the answer is:

The Answer is: A

Multiple choice technology mainframe
  1. Subscripting enables us to write a more compact code in the procedure division.

  2. Subscripting enables us to refer to any element of a table by the same data name with the facility of identifying the particular element through the values of subscript

  3. Subscripting reduces the number of entries to be included in the data division.

  4. Subscripting enables us to use loops in the procedure division.

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

The question asks which statement is INCORRECT. Subscripting allows referring to table elements by index, reduces data division entries, and enables compact code. However, subscripting itself is a table access mechanism - it doesn't inherently enable loops (PERFORM with VARYING enables loops). So claiming subscripting enables loops is incorrect.

Multiple choice technology mainframe
  1. There is either a JCLLIB statement for the entire JOB, or a separate one for each EXEC

  2. A JCLLIB statement can not have a statement name.

  3. There can only be one JCLLIB statement per JOB.

  4. A JCLLIB statement must be coded before the first EXEC statement.

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

JCLLIB statement rules: Only one JCLLIB statement per JOB is allowed (makes sense for specifying a single procedure library). It must be placed before the first EXEC statement. It can have a statement name (though rarely used). Therefore A and B are false, C and D are true.

Multiple choice technology mainframe
  1. The COND parameter always indicates that if its condition is met, the step is NOT executed.

  2. When adding the COND parameter to an EXEC statement that calls a procedure, this COND

  3. With the COND parameter, we can only check return codes.

  4. The COND parameter can check the return codes of multiple steps, but as soon as one of

Reveal answer Fill a bubble to check yourself
B,D Correct answer
Multiple choice technology mainframe
  1. //TU00001T JOB (ATUT000,,,,,,,,),TU00001,CLASS=7,MSGCLASS=X

  2. //TU00001T JOB (ATUT000),’TU00001’,CLASS=7,MSGCLASS=X

  3. //TU00001T JOB TU00001,’(ATUT000)’,CLASS=7,MSGCLASS=X

  4. //TU00001T JOB ,(ATUT000),CLASS=7,MSGCLASS=X

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

In JOB statement syntax, positional parameters follow strict order: accounting info (positional 1), programmer name (positional 2 or keyword NAME), then keyword parameters. Option A uses positional for both (ATUT000 as pos1, TU00001 as pos2 via NAME keyword's positional form). Option B uses explicit keyword syntax. Both are valid. Options C and D incorrectly mix positional and keyword syntax.

Multiple choice technology web technology
  1. Faster

  2. Slower

  3. The execution speed is similar

  4. All of above

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

To solve this question, the user needs to know basic concepts of programming languages and how they are executed.

The answer is:

B. Slower

Scripts are interpreted line by line during runtime, whereas compiled programs are translated into machine language (binary code) before runtime. This means that compiled programs are faster than scripts because they do not require interpretation during runtime. On the other hand, scripts are easier to write, modify, and debug because they do not need to be compiled before execution.

Multiple choice technology web technology
  1. $get
  2. $ask
  3. $request
  4. $post
Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

$ask is not a predefined variable in PHP. PHP has several predefined superglobal variables (automatically available in all scopes): $_GET, $_POST, $_REQUEST, $_SERVER, $_FILES, $_COOKIE, $_SESSION, $_ENV, and $GLOBALS. The question uses lowercase $get, $post, $request which are technically not the correct superglobal names (should be $_GET, $_POST, $_REQUEST), but $ask is definitely not a predefined PHP variable in any form.