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 packaged enterprise solutions
  1. When you want to invoke a MapValue (not a MapValue Pair)

  2. When you want to test something about the work object

  3. They are interchangeable

  4. All of the above

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

This question appears to be about flow control shapes. Fork and Decision shapes serve similar branching purposes in many flow systems and can often be used interchangeably for routing logic, though they have different primary design intents.

Multiple choice technology databases
  1. The SQL statements in the IF condition are processed.

  2. The SQL statements in the ELSE condition are processed.

  3. IF-THEN-ELSE-ENDIF construct is skipped.

  4. The SQL statements in the IF condition as well as ELSE condition are processed.

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

When the IF condition evaluates to NULL in PL/SQL, it's treated as FALSE and the entire IF-THEN-ELSE construct is skipped - neither the IF nor ELSE blocks execute. PL/SQL doesn't process NULL as a separate logical state in conditional constructs.

Multiple choice technology web technology
  1. Loop

  2. IF-THEN-ELSE-ENDIF construct

  3. Block

  4. Exception

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

Statement labels in PL/SQL can name loops and blocks for control flow purposes like EXIT label_name or GOTO label_name. They cannot be used with IF-THEN-ELSE constructs or exception handlers directly - those structures use END IF and END exception_name instead.

Multiple choice technology databases
  1. DECLARE

  2. OPEN

  3. FETCH

  4. CLOSE

  5. PROCESS

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

In PL/SQL cursor FOR loops, the OPEN, FETCH, and CLOSE operations are handled automatically by the loop construct. The loop opens the cursor when entered, fetches each row iteratively, and closes the cursor when the loop completes or exits. The cursor must still be explicitly DECLARED, and the PROCESS step (loop body logic) is written by the developer.

Multiple choice technology databases
  1. round

  2. trunc

  3. maximum

  4. initcap

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

Oracle SQL has ROUND, TRUNC, and INITCAP as built-in functions for numeric rounding, truncation, and string capitalization respectively. 'MAXIMUM' is NOT a valid Oracle function - the correct aggregate function is MAX (not MAXIMUM). This is a common trick question testing knowledge of exact function names.

Multiple choice technology databases
  1. True

  2. False

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

In PL/SQL exception handling, OTHERS is indeed a catch-all exception handler that encompasses all predefined exceptions (like NO_DATA_FOUND, TOO_MANY_ROWS, etc.) as well as user-defined exceptions. When you use EXCEPTION WHEN OTHERS, it will catch any exception that hasn't been handled by more specific exception handlers above it. This makes it the most general exception type.

Multiple choice technology databases
  1. concat

  2. initcap

  3. round

  4. length

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

To answer this question, the user needs to know what string functions are and be familiar with some commonly used string functions.

String functions are functions that operate on a string and return a modified string or information about the string. Some examples of string functions include substring, upper/lower case, length, concat, and trim.

Now, let's go through each option and determine which one is not a string function:

A. concat: This is a string function that concatenates two or more strings together.

B. initcap: This is a string function that capitalizes the first letter of each word in a string.

C. round: This is not a string function. It is a mathematical function that rounds a number to a specified number of decimal places.

D. length: This is a string function that returns the length of a string.

Therefore, the answer is:

The Answer is: C

Multiple choice technology databases
  1. O

  2. oracle

  3. Oracle

  4. ORACLE

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

INITCAP converts a string to initial capitalization - first letter of each word uppercase, remaining letters lowercase. For 'oracle', it returns 'Oracle'. For 'hello world', it would return 'Hello World'. The function capitalizes the first character and lowercases the rest.

Multiple choice technology databases
  1. to_date(string,format)

  2. to_char(date,format)

  3. to_date(date,format)

  4. to_number(string,format)

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

The to_char function converts a date value to a string representation in the specified format. Option B is the correct PostgreSQL and Oracle function. Option A (to_date) converts string to date, option C is an invalid signature, and option D converts strings to numbers, not dates to strings.

Multiple choice technology enterprise content management
  1. r_frozen_flag

  2. r_has_frzn_assembly

  3. both

  4. none

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

The r_frozen_flag attribute is set to true when an object is explicitly frozen using the freeze() method, indicating it's now immutable. The r_has_frzn_assembly attribute indicates frozen assembly membership but is not the direct flag for individual object freeze status.

Multiple choice technology enterprise content management
  1. r_frozen_flag

  2. r_has_frzn_assembly

  3. both

  4. none

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

The r_frozen_flag attribute is set to true when an object is explicitly frozen using the freeze() method, indicating it's now immutable. The r_has_frzn_assembly attribute indicates frozen assembly membership but is not the direct flag for individual object freeze status.

Multiple choice technology testing
  1. Function Generator

  2. Step Factory

  3. Function Factory

  4. None

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

In QTP/UFT, the Step Generator (sometimes called Step Factory in documentation) is the feature used to construct test steps by selecting operations on test objects. Function Generator is used for inserting functions, not constructing steps with object operations.