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. Identification

  2. Procedure

  3. Data

  4. Environment

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

The LINKAGE SECTION in COBOL is part of the DATA DIVISION. It defines data items that are passed between programs when one program calls another. The other divisions are IDENTIFICATION DIVISION, PROCEDURE DIVISION, and ENVIRONMENT DIVISION, but the linkage section specifically belongs to DATA DIVISION.

Multiple choice technology programming languages
  1. A

  2. AA

  3. Can't locate object method "foo" via package "A"

  4. none of the above

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

In Perl, the bareword construction NEW A acts as a method call A->NEW(). Inside AUTOLOAD, calling ref(shift) prints the reference package name A twice: first for the invalid method call foo(), and a second time when the object goes out of scope and triggers the DESTROY method.

Multiple choice technology programming languages
  1. True

  2. False

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

A->new('foo') passes 'A' as \$class and 'foo' as \$param (correct). new A('foo') also passes 'A' as \$class and 'foo' as \$param (correct). However, A::new('A', 'foo') is NOT equivalent - it bypasses Perl's inheritance mechanism and directly calls the subroutine, which fails if new() is inherited from a parent class. The third form is methodologically different.

Multiple choice technology programming languages
  1. $string =~ s/<*&>//g;
  2. $string =~ s/<\s*>//g;
  3. $string =~ s/<.*?>//g;
  4. $string =~ s/<.*>//g;
Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The pattern <.> matches any text enclosed in angle brackets. The * quantifier is greedy by default, matching as much as possible. For nested tags like , <.> matches from the first < to the last >, removing all content between. Option D is the correct greedy regex that deletes all HTML tags.

Multiple choice technology web technology
  1. ASPApplication

  2. HttpsApplication

  3. ASPNETApplication

  4. NETApplication

  5. HttpApplication

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

When ASP.NET parses and compiles global.asax, it creates a dynamic class that inherits from HttpApplication (note: not ASPApplication, HttpsApplication, ASPNETApplication, or NETApplication). This base class provides application-level events and functionality.

Multiple choice technology platforms and products
  1. Java

  2. C++

  3. Objective-C

  4. Ruby

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

Java has historically been the primary programming language for Android application development, supported by the official Android SDK. While C++ can be used via NDK, it's not the primary development language. Objective-C is used for iOS, not Android. Ruby is not natively supported for Android development.

Multiple choice technology web technology
  1. Flash Programming

  2. Action programming

  3. Game Progamming

  4. Science Programming

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

ActionScript is the programming language specifically designed for Adobe Flash (and Flex) applications, used for creating interactive content, animations, and application logic within the Flash platform.

Multiple choice technology programming languages
  1. True

  2. False

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

The code uses tryVariableArguments.arguments which is an obsolete, deprecated syntax. In modern JavaScript (and even in older implementations), the correct way is to use the arguments object directly within the function, not as a property of the function name. This code will fail in contemporary browsers.

Multiple choice technology programming languages
  1. True

  2. False

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

JavaScript functions are first-class objects and their names are identifiers within the same scope. Declaring a function and variable with the same name causes a namespace collision where one overrides the other. Because JavaScript does not separate these namespaces, it does not distinguish between them.

Multiple choice technology programming languages
  1. True

  2. False

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

parseJSON is not a standard built-in JavaScript function. The standard method for parsing JSON strings is JSON.parse(). The parseJSON function might have existed in some non-standard implementations or specific libraries, but it's not part of core JavaScript like alert() or eval().

Multiple choice technology programming languages
  1. a.SAS continues processing the step.

  2. a.SAS continues to process the step, and the SAS log displays messages about the error.

  3. a.SAS stops processing the step in which the error occurred, and the SAS log displays messages about the error.

  4. SAS stops processing the step in which the error occurred, and the Output window displays messages about the error.

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

When SAS encounters a syntax error, it immediately stops processing the step containing the error, prints warning or error messages to the SAS log, and continues checking subsequent steps. It does not output these messages to the Output window.

Multiple choice technology web technology
  1. Out-of-synch

  2. Divide by zero

  3. Soc7

  4. If condition

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

Out-of-synch is a condition identified through the audit process in ChangeMan, indicating inconsistency with development procedures or other code problems. It occurs when components don't match their expected state. Divide by zero and SOC7 are runtime abend conditions, while If condition is a programming construct.

Multiple choice technology
  1. Java

  2. Python

  3. C/C++

  4. Scheme

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

Java, Python, C/C++, and Scheme are all programming languages. Java and Python are widely used high-level languages, C/C++ provides low-level control, and Scheme is a functional programming language.

Multiple choice technology web 2.0
  1. Servelt

  2. PHP

  3. Javascript

  4. ASP

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

Javascript is historically and primarily a client-side scripting language executed in the browser, whereas Servlets, PHP, and ASP are designed specifically for server-side execution. While modern environments like Node.js enable server-side JavaScript, in standard web development contexts, Javascript is categorized as client-side.