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 programming languages
  1. Java

  2. Cobra

  3. VC++

  4. Python

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

Python is well-known for using significant whitespace (indentation) to define block structure, unlike languages like Java, C++, or Cobra that use braces/end keywords. Python's syntax relies on consistent indentation for nested blocks, making it the correct answer. Options A, B, C use brace-based syntax.

Multiple choice technology programming languages
  1. Compiled

  2. Interpreted

  3. Both

  4. None

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

Perl is primarily an interpreted language, though Perl scripts can be compiled to bytecode. Unlike C or Java which are compiled to native code, Perl code is typically executed by the Perl interpreter. Option B correctly identifies Perl as interpreted.

Multiple choice technology programming languages
  1. Practically Extracted Reporting Language

  2. Practical Extraction report Language

  3. Practical Extraction and report Language

  4. Practical Export and report Language

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

Perl officially stands for 'Practical Extraction and Reporting Language'. Option C has the exact wording. Options A and B have 'Extracted' instead of 'Extraction' and missing 'and'. Option D uses 'Export' which is incorrect.

Multiple choice technology mainframe
  1. Replace the copybook with another.

  2. The option is invalid with copy statement.

  3. It allows for the same copy to be used more than once in the same code by changing the replace value.

  4. Has no impact.

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

The REPLACING option allows text substitution in copybooks, enabling the same copybook to be used multiple times with different values by changing what gets replaced during compilation. It does not replace the entire copybook (A), is valid with COPY statement (B is wrong), and definitely has an impact.

Multiple choice technology mainframe
  1. Occurs clause in 01 cant be done because 01 is the top most level.

  2. Who said so, you can use it, I bet!

  3. Occurs clause is there to repeat fields with same format, not the records.

  4. Stack will over flow.

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

While the OCCURS clause is technically permitted at 01 level in COBOL, the reasoning in option C correctly identifies its semantic purpose - OCCURS is designed to repeat fields within a record structure, not entire records. Options A and B are incorrect explanations. Stack overflow (D) is irrelevant.

Multiple choice technology mainframe
  1. Yes

  2. No

  3. X(245) can be refined to X(250)

  4. Author should learn COBOL

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

REDEFINES allows redefining a data item with another of equal or smaller length. Redefining X(250) with X(245) is valid - the smaller length is permitted. The reverse (X(245) to X(250)) would not be allowed.

Multiple choice technology testing
  1. CreatePage = New Pages

  2. New CreatePage = Pages()

  3. Set CreatePage = New Pages

  4. Dim CreatePage = New Pages

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

VBScript requires the 'Set' keyword when assigning object references. The correct syntax is 'Set CreatePage = New Pages'. Options A and B use incorrect syntax without Set or with wrong keyword order, and Dim cannot be combined with New in the same statement.

Multiple choice technology programming languages
  1. True

  2. False

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

C# does not support multiple inheritance with classes - a class can only inherit from one base class. However, C# does support multiple inheritance through interfaces (a class can implement multiple interfaces). The statement refers to class inheritance, which is not supported.

Multiple choice technology programming languages
  1. Javadoc

  2. J#

  3. C++

  4. Cdoc

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

C# uses XML documentation comments (///) that are conceptually similar to Javadoc's /** */ syntax. Both systems allow embedding documentation directly in source code that can be extracted into formatted HTML documentation. Option D 'Cdoc' is not a real documentation system.