Computer Knowledge

Programming Languages and Compilers

2,284 Questions

Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.

Object oriented languagesScripting languagesCompilers and parsersProgramming syntax

Programming Languages and Compilers Questions

Multiple choice technology databases
  1. PL/SQL

  2. SQL

  3. SQL*PLUS

  4. JAVA

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

PL/SQL (Procedural Language extensions to SQL) is Oracle's procedural programming language that combines SQL data manipulation with procedural constructs like variables, conditions, loops, and exception handling. It enables custom program logic to execute within the Oracle database server.

Multiple choice technology testing
  1. A. Call the ADO.Close function

  2. B. Use the close method for the RecordSet object

  3. C. Set the RecordSet and Connection objects equal to Nothing

  4. D. Use the close method for the RecordSet and Connection objects

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

After executing an SQL query and examining the results, you must close both the RecordSet object (which holds the query results) and the Connection object (which manages the database connection). Simply setting objects to Nothing does not properly close them and can lead to resource leaks. The close method should be called on both objects explicitly.

Multiple choice technology testing
  1. A. Fields

  2. B. Execute

  3. C. Connection, RecordSet

  4. D. Open, ConnectionString

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

The Connection object establishes the link to the data source, while the RecordSet object holds the data returned from a query. These are the two fundamental ADO objects used in almost all database operations. Fields is a property collection within RecordSet, Execute is a method, and Open/ConnectionString are related to connection establishment but are not objects themselves.

Multiple choice technology packaged enterprise solutions
  1. Getrecord

  2. Getrow

  3. Getcomponent

  4. Getfield

  5. Getlevel

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

In PeopleCode, GetLevel, GetRow, GetRecord, and GetField are standard classes and methods used to traverse the buffer hierarchy. There is no Getcomponent function or method used for buffer traversal; components are accessed via different APIs.

Multiple choice technology web technology
  1. Local

  2. function parameter

  3. static

  4. None of above

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

Static variables retain their value between function calls because they are allocated in static memory and persist across function invocations. Local variables are destroyed when the function returns, and function parameters are reinitialized on each call.

Multiple choice technology web technology
  1. delimited by single quote

  2. delimited by double quote

  3. delimited by <<< identifier

  4. All of above

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

In PHP, the heredoc syntax defined by &lt;&lt;&lt; followed by an identifier allows string interpolation, meaning variables inside the heredoc block are evaluated. Double quotes also support interpolation, making the option 'All of above' or a more specific answer arguable, but in standard terminology, heredocs are explicitly grouped here.

Multiple choice technology web technology
  1. Local variables

  2. Function parameters

  3. Hidden variables

  4. Global variables

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

PHP supports local variables (function-scoped), global variables (accessible with global keyword or $GLOBALS), and function parameters. 'Hidden variables' is not a recognized scope type in PHP - the language only has local, global, static, and function parameter scopes.

Multiple choice technology web 2.0
  1. split()

  2. document.clear()

  3. join()

  4. charAt()

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

To answer this question, the user needs to have knowledge about the features supported by MSIE 3.x.

The correct answer is:

B. document.clear()

Option B is correct because the document.clear() method is supported in MSIE 3.x. This method clears the contents of the current document and is used to remove all the elements from the document.

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

A. split(): This method is used to split a string into an array of substrings. However, this method is not supported in MSIE 3.x.

B. document.clear(): This method is used to clear the contents of the current document. This method is supported in MSIE 3.x.

C. join(): This method is used to join all elements of an array into a string. However, this method is not supported in MSIE 3.x.

D. charAt(): This method is used to return the character at a specified index in a string. This method is supported in MSIE 3.x, but it is not the correct answer to this question.

Therefore, the correct answer is B.

The Answer is: B. document.clear()

Multiple choice technology web 2.0
  1. The duration of the browser session.

  2. The duration the current document stays loaded.

  3. Twenty-four hours from the time the cookie is set.

  4. There is no default setting.

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

By default, cookies persist only for the duration of the browser session - they are deleted when the browser closes unless an explicit expires attribute is set. They don't default to 24 hours and do have a default setting (session duration).

Multiple choice technology web 2.0
  1. a low-level programming language.

  2. a scripting language precompiled in the browser

  3. a compiled scripting language.

  4. an object-oriented scripting language.

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

JavaScript is best described as an object-oriented scripting language. It is not precompiled in the browser (it uses JIT compilation or interpretation), nor is it a low-level language or a statically compiled language.

Multiple choice technology web 2.0
  1. Database

  2. Cursor

  3. Client

  4. FileUpLoad

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

In classic client-side JavaScript, the FileUpload object represents an HTML file input element in the browser. Objects like Database, Cursor, and Client were specific to Netscape's historical server-side JavaScript (SSJS) implementation.

Multiple choice technology mainframe
  1. Identification Division

  2. Environment Division

  3. Data Division

  4. Procedure Division

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

The Identification Division is the only division that is mandatory in every COBOL program. It identifies the program to the compiler and must be present in all COBOL code. The Environment, Data, and Procedure divisions are commonly used but not all are mandatory.

Multiple choice technology mainframe
  1. True

  2. False

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

The VALUE...THRU clause in COBOL allows you to specify ranges with control over collating sequence direction. You can write VALUE 'A' THRU 'Z' for ascending order or VALUE 'Z' THRU 'A' for descending order. The clause respects the order specified, giving flexibility in range definitions.