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 packaged enterprise solutions
  1. "$baseclass"
  2. "@baseclass"

  3. pegabaseclass

  4. pzBaseClass

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

In PegaRULES Process Commander (PRPC), @baseclass is the ultimate base class from which all other classes inherit. It contains standard properties, activities, and rules available to all applications. Other choices like $baseclass or pzBaseClass are syntactically or contextually incorrect.

Multiple choice technology web technology
  1. True

  2. False

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

ASP.NET Mobile Controls were deprecated by Microsoft and are not recommended for ASP.NET 4.0 mobile web development. Instead, Microsoft recommends using modern approaches like responsive web design, ASP.NET MVC, or CSS media queries to create mobile-friendly applications.

Multiple choice technology programming languages
  1. Python

  2. PHP

  3. JavaScript

  4. ActionScript

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

PHP is a server-side scripting language designed for web development, freely available, and commonly used on Linux web servers as an alternative to Microsoft's Active Server Pages (ASP). Python and JavaScript are also scripting languages but are not primarily known as ASP alternatives in the web server context. ActionScript is primarily used for Flash applications, not web servers.

Multiple choice technology programming languages
  1. Python

  2. PHP

  3. JavaScript

  4. ActionScript

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

PHP is a server-side scripting language designed for web development, commonly used on Linux web servers as an alternative to Microsoft's ASP (Active Server Pages). It is open-source, freely available, and can be embedded into HTML. Python and JavaScript are general-purpose languages, and ActionScript is for Flash multimedia.

Multiple choice technology testing
  1. Redim Retain arr(s)

  2. Redim Preserve arr(s)

  3. Redim Persist arr(s)

  4. Redim CarryForward arr(s)

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

In VBScript, when you resize a dynamic array using Redim, the existing values are normally lost. The Preserve keyword retains the existing values when resizing. Redim Retain, Persist, and CarryForward are not valid VBScript keywords for this purpose.

Multiple choice technology testing
  1. Issue2, Issue3, Issue6

  2. Issue1, Issue2, Issue3

  3. Issue2, Issue4, Issue6

  4. No issues - The code is perfect

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

The code has three issues: (1) The loop condition 'While rs.EOF' should be 'While Not rs.EOF' to iterate while there ARE records; (2) Missing 'rs.MoveNext' inside the loop to advance to the next record; (3) Missing 'Set' keyword in 'rs = con.Execute' - should be 'Set rs = con.Execute' for object assignment.

Multiple choice technology testing
  1. collection having child nodes/elements

  2. a node/child

  3. true if there are children and false if no children

  4. root node

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

In UFT/QTP XMLUtil, the ChildElements method returns an XMLCollection containing all the child elements/nodes of the specified element. It does not return a single node, boolean status, or the root node.

Multiple choice technology testing
  1. collection_obj.element(0)

  2. collection_obj.Item(0)

  3. collection_obj.node(0)

  4. No such property

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

In VBScript with XML DOM, the Item property (not element or node) is the indexed property used to retrieve child nodes from a collection. The syntax collection_obj.Item(0) retrieves the first item from the collection (note that in some contexts this may be 0-indexed or 1-indexed depending on the specific collection type). Options A and C use incorrect property names that are not valid DOM collection methods.

Multiple choice technology mainframe
  1. The control will come back to Program A

  2. The control will not come back to Program A and program B will terminate at the end of the STOP RUN statement

  3. Program B abends Abnormally

  4. Infinite loop

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

In COBOL, the STOP RUN statement terminates the entire run unit, not just the current program. When Program B (called program) executes STOP RUN, it immediately ends program execution and control does NOT return to Program A (the calling program). This is different from GOBACK or EXIT PROGRAM which would return control to the caller.

Multiple choice technology mainframe
  1. Perform Para-1

  2. Perform Para-1 Thru Para-2

  3. Perform Section-2 Section

  4. Perform Para-1 20 times

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

In COBOL, you perform paragraphs or sections. 'Perform Section-2 Section' is invalid syntax because appending the word 'Section' after the name in a PERFORM statement is incorrect. The other statements are valid standard COBOL syntax formats.

Multiple choice technology mainframe
  1. Identification

  2. Procedure

  3. Data

  4. Environment

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

The Linkage Section is part of the Data Division in COBOL and is used to define data items that are passed between programs or as parameters to a program. It's not part of Identification, Procedure, or Environment divisions.

Multiple choice technology mainframe
  1. Infinite loop

  2. Logical Error

  3. Runtime Error

  4. All the above

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

COBOL IF statements can generate multiple error types: infinite loops from poorly designed conditions, logical errors from incorrect condition logic, and runtime errors from data type mismatches or boundary violations. All three error categories are possible in IF statement implementations.