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. C++

  2. Java

  3. Simula

  4. None of the above

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

Simula 67 was the first language to introduce key object-oriented concepts like classes, objects, inheritance, and subclasses. C++ and Java are multi-paradigm languages that also support non-OO features like primitive types, making them not 'fully' object-oriented.

Multiple choice technology programming languages
  1. strcpy

  2. memcpy

  3. both memcpy and strcpy

  4. none

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

memcpy is theoretically faster because it knows the exact byte count upfront and can optimize the copy accordingly. strcpy must scan for the null terminator to find the length, then copy character by character until it finds it. In the given code, msg is 12 bytes (including null terminator), so memcpy copies exactly 12 bytes directly. strcpy has to first find where the string ends, then copy. Modern compilers may optimize strcpy calls when the size is known, but theoretically memcpy is faster.

Multiple choice technology platforms and products
  1. Code-Pega-List

  2. Rule-Pega-Obj

  3. pxResults

  4. The same class as the returned instance

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

In Pega, the Obj-List method creates a top-level clipboard page of class Code-Pega-List to hold the search results. The actual instances returned by the query are stored inside the pxResults page list embedded within this Code-Pega-List page.

Multiple choice technology platforms and products
  1. Rule-File-Binary.

  2. Rule-File-Text

  3. Rule-Obj-Binary

  4. Rule-Obj-Text

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

Rule-File-Binary is the Pega rule type designed to store binary file content, including images like JPG, JPEG files, GIFs, and other non-text files. Rule-File-Text stores text-based files, while Rule-Obj-Binary and Rule-Obj-Text are not valid Pega rule class names for file storage purposes.

Multiple choice technology platforms and products
  1. Process Page

  2. Requestor Page

  3. Thread page

  4. User Pages

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

The Requestor Page is a special clipboard page in Pega that maintains session-level information for each user requestor (session). It stores critical runtime information including the user's access roles and privileges, the RuleSet list (determining which rules are available to the user), and HTTP protocol parameters. Process Page, Thread Page, and User Pages are not the correct names for this system clipboard page.

Multiple choice technology platforms and products
  1. Code-Pega-List

  2. Rule-Pega-Obj

  3. pxResults

  4. The same class as the returned instance

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

The Obj-List method creates a top-level clipboard page with class Code-Pega-List. This is a system class specifically designed to hold list results generated by the Obj-List method. Rule-Pega-Obj is for object rules, pxResults is a property name within the list page, and the class is not determined by the returned instance type.

Multiple choice technology testing
  1. possible communications bottlenecks in a program.

  2. the rate of change of data values as a program executes

  3. the use of data on paths through the code

  4. the intrinsic complexity of the code.

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

Data flow analysis (option C) studies how data is used and flows on paths through code - where variables are defined, used, and killed. It's a white-box technique that identifies potential anomalies like using variables before initialization. Option A refers to performance analysis, not data flow. Option B is incorrect - data flow doesn't study rate of change. Option D describes complexity metrics like cyclomatic complexity, which is different from data flow analysis.

Multiple choice technology databases
  1. Me.DataBindings.Add(“chkIsEmployee.Checked”, dsOrg, “Users.IsEmployee”)

  2. chkIsEmployee.DataBindings.Add(“Checked”, dsOrg, “IsEmployee”)

  3. chkIsEmployee.Text = “{Users.IsEmployee}” chkIsEmployee.AutoCheck = True

  4. chkIsEmployee.DataBindings.Add(“Checked”, dsOrg, “Users.IsEmployee”)

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

DataBinding syntax requires: control.DataBindings.Add("PropertyName", dataSource, "DataMember"). For checkbox Checked property binding to Users.IsEmployee, the correct syntax is chkIsEmployee.DataBindings.Add("Checked", dsOrg, "Users.IsEmployee").

Multiple choice technology
  1. Format Translator

  2. Form Translator

  3. File or Translator

  4. Formula Translator

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

FORTRAN stands for 'Formula Translator,' not Format, Form, or File Translator. It was developed in the 1950s specifically for scientific and engineering calculations that involved complex mathematical formulas. The name directly reflects its purpose: translating mathematical formulas into executable code.

Multiple choice technology programming languages
  1. JIT

  2. Language Specific Compiler

  3. MSIL

  4. CTS

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

MSIL (Microsoft Intermediate Language) is the key to .NET language interoperability. All .NET languages compile to MSIL, which then runs on the CLR. This allows code written in different .NET languages (C#, VB.NET, F#) to work together seamlessly. JIT converts MSIL to native code at runtime, while CTS defines common types but MSIL is the actual interoperability mechanism.

Multiple choice technology mainframe
  1. Portable Format Reader

  2. Portable File Reader

  3. Production Development Facility

  4. Program Development Facility

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

In the mainframe context, PDF stands for Program Development Facility. It's an IBM mainframe tool used for program development, not to be confused with the more common Portable Document Format. The mainframe PDF is an interactive development environment for creating and maintaining programs on IBM mainframe systems.

Multiple choice technology programming languages
  1. It produces the output Procedure B calling C

  2. It produces the output Procedure C calling B

  3. It produces a compilation error because procedure C requires a forward declaration

  4. It produces a compilation error because procedure B requires a forward declaration.

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

In PL/SQL packages, procedures must be declared before they can be called by other procedures in the same package specification or body. If procedure B calls procedure C, and C is defined after B in the package body without a forward declaration, the compiler cannot resolve the reference to C when compiling B.

Multiple choice technology programming languages
  1. Num variable of Myclass is initialized to 10

  2. Run Time Error

  3. Compiler Error

  4. StackOverflow Exception

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

The code has a compiler error because variable 'c' is declared without the 'Dim' keyword. In VB.NET, all variable declarations require 'Dim', 'Public', 'Private', or similar keywords. The line 'Dim c as Myclass' is missing this keyword.

Multiple choice technology programming languages
  1. Num variable of Myclass is initialized to 10

  2. Run Time Error

  3. Compiler Error

  4. StackOverflow Exception

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

The constructor in MyClass is declared as Private, which means it cannot be accessed from outside the class. When Test.Main tries to create an instance with 'C=New Myclass(10)', the compiler detects this accessibility violation and fails before runtime.

Multiple choice technology mainframe
  1. a program must always begin with a PROCEDURE statement and end with an END statement

  2. PL/I instructions can be coded between positions 1 and 72

  3. you have to declare each variable that you are going to use

  4. a program can be composed out of different procedures

  5. comment lines have to be preceded by //

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

PL/I programs must begin with a PROCEDURE statement and end with an END statement as structural requirements. The language supports modular programming by allowing programs to be composed of multiple procedures. Claims about column limits and mandatory variable declarations are incorrect, and PL/I uses /* */ for comments, not //.