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 mainframe
  1. The simple PERFORM statement

  2. The PERFORM with TIMES option

  3. The PERFORM with UNTIL option

  4. The PERFORM with VARYING option

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

A simple PERFORM statement executes the target paragraph exactly once and transfers control. In contrast, the TIMES, UNTIL, and VARYING options are designed for looping, which can cause the paragraph to execute multiple times, making the simple statement the correct choice.

Multiple choice technology mainframe
  1. If statements

  2. Evaluate

  3. Perform statement

  4. Copy statement

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

In COBOL, the EVALUATE statement functions like a switch or case structure, allowing multiple alternative paths of execution based on conditions. Distractors like PERFORM, COPY, or IF statements do not match this specific definition or syntax for handling multiple branches cleanly.

Multiple choice technology architecture
  1. UML to Java

  2. UML to C

  3. UML to C++

  4. None of the above

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

Round-trip engineering allows reversing transformations between UML and Java because Java preserves enough structure to reconstruct the UML. C lacks this expressiveness - its low-level constructs and procedural nature lose UML semantic information irreversibly. The same applies to C++.

Multiple choice technology architecture
  1. C++

  2. Java

  3. SmallTalk

  4. WSDL

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

IBM Rational Software Architect (RSA) provides built-in UML transformations for commonly used languages and standards like C++, Java, and WSDL. SmallTalk is an older object-oriented language that is not typically supported out of the box in modern RSA versions due to its limited industry adoption today. The transformation requires additional plugins or custom configuration.

Multiple choice technology programming languages
  1. Low Level Language

  2. High Level Language

  3. Machine Level Language

  4. Binary Level Language

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

SAS is a high-level software suite/programming language designed for advanced analytics, data management, and business intelligence, shielding users from hardware-level complexity. Low-level, machine, and binary languages represent instructions directly executed by CPU architectures.

Multiple choice technology mainframe
  1. Directed Inheritance

  2. Pattern Inheritance

  3. Class Inheritance

  4. Genetic Inheritance

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

In PegaRULES Process Commander, pattern inheritance relies on alphabetical class naming where classes inherit from parent classes that match their name pattern. The Class Explorer's alphabetical view reveals this pattern inheritance structure. Direct inheritance follows explicit parent-child relationships instead.

Multiple choice technology programming languages
  1. C

  2. C++

  3. PASCAL

  4. FORTAN

  5. TAL

  6. All of the above

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

COBOL 85 programs can invoke routines written in multiple programming languages including C, C++, Pascal, and Fortran through language interop capabilities. The TAL (Transaction Application Language) is also supported in HP NonStop environments. Therefore, all of these languages can be called from COBOL.

Multiple choice technology programming languages
  1. C

  2. C++

  3. PASCAL

  4. FORTAN

  5. TAL

  6. All of the above

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

COBOL 85 supports calling routines written in other programming languages through Language Environment (LE) and inter-language communication interfaces. This includes C (for system-level operations), C++ (through appropriate interfaces), Pascal, Fortran (misspelled as 'FORTAN' in option D), and TAL (Tandem Application Language, a system programming language for Tandem/NonStop systems). Therefore, all of these languages can be invoked from COBOL 85.

Multiple choice technology programming languages
  1. do i=1 to dim(tmp);

  2. do i=1 to dim(*);

  3. do i=1,2,3,4;

  4. do i=1 to 4;

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

The dim function in SAS requires a valid array name as its argument to return the number of elements. Using dim(*) is syntactically invalid and causes an error. In contrast, dim(tmp), a list of explicit indices 1,2,3,4, or the range 1 to 4 correctly reference all four array elements.

Multiple choice technology programming languages
  1. can be used to manipulate character strings in macro variable values.

  2. have the same basic syntax as the corresponding DATA step functions and yield similar results.

  3. all of the above

  4. none of the above

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

Macro character functions in SAS can manipulate character strings in macro variables and share the same syntax as corresponding DATA step functions, yielding similar results. The 'all of the above' option correctly encompasses both characteristics.

Multiple choice technology packaged enterprise solutions
  1. System creates private ruleset automaticaly when needed

  2. instance of the Rule-Ruleset-Name class exists for a private RuleSet

  3. name of this RuleSet is the same as their Operator ID

  4. None

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

A private ruleset (used for personal checkouts) is automatically managed by the system. Crucially, no actual Rule-Ruleset-Name instance is created in the database for a private ruleset, making the statement false and therefore the correct answer.

Multiple choice technology mainframe
  1. Job Circuit Language

  2. JCL Control Language

  3. Job Control Language

  4. JCL Course Language

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

JCL stands for Job Control Language, which is used on IBM mainframe systems to define jobs and tell the operating system what resources are needed. Option A incorrectly suggests 'Circuit' instead of 'Control'. Option B is redundant ('JCL Control Language' would repeat 'Control'). Option D incorrectly suggests 'Course' rather than 'Control'.

Multiple choice technology mainframe
  1. True

  2. False

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

COBOL (Common Business-Oriented Language) was developed in 1959 by the CODASYL committee to address business programming needs. It is classified as a high-level language because it uses English-like syntax and abstracts away low-level machine details, making it readable and maintainable.