Computer Knowledge

Programming Languages and Compilers

1,170 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
  1. a machine language

  2. short for Beginner’s All-Purpose Symbolic Instruction Code

  3. a high-level language

  4. useful only for writing business programs

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

BASIC stands for Beginner's All-Purpose Symbolic Instruction Code. It is a high-level language designed for beginners and general-purpose applications, not machine language or business-only use.

Multiple choice
  1. assembly

  2. machine

  3. low-level

  4. high-level

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

High-level programming languages are designed to be easier for humans to read, write, and understand. They use English-like statements and abstractions that hide complex machine operations. Low-level languages like assembly and machine code are closer to how computers actually process data.

Multiple choice
  1. English-like words

  2. 1s and 0s representing high and low electrical states

  3. BASIC

  4. Symbolic names to represent storage locations

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

Machine language is the lowest-level programming language, directly executable by the computer's CPU. It consists entirely of binary digits (1s and 0s) representing high and low electrical states. This is what all high-level languages must eventually be translated into for execution.

Multiple choice
  1. It translates one statement of high level language program to machine language and immediately execute it.

  2. A translate which translates entire high level language to machine language and then executes it.

  3. It executes the program only.

  4. None of the above

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

A compiler translates the entire high-level language program to machine language before execution, creating an executable file. This distinguishes it from interpreters (which translate and execute one statement at a time, described in option A) and pure executors. Option B correctly describes the compiler's two-step process.

Multiple choice
  1. C

  2. C++

  3. Java

  4. FORTRAN

  5. LISP

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

The Abstract Window Toolkit (AWT) is Java's original platform-independent windowing, graphics, and user-interface widget toolkit. The AWT is now part of the Java Foundation Classes (JFC) — the standard API for providing a graphical user interface (GUI) for a Java program. AWT is also the GUI toolkit for a number of Java ME profiles.

Multiple choice
  1. C

  2. Fortran

  3. BASIC

  4. JAVA

  5. COBOL

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

Java is a general-purpose, concurrent, class-based, object-oriented computer programming language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers write once, run anywhere (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another.

Multiple choice
  1. Line reconstruction

  2. Lexical analysis

  3. Preprocessing

  4. Syntax analysis

  5. Semantic analysis

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

Lexical analysis breaks the source code text into small pieces called tokens. Each token is a single atomic unit of the language, for instance a keyword, identifier or symbol name. The token syntax is typically a regular language, so a finite state automaton constructed from a regular expression can be used to recognize it. This phase is also called lexing or scanning, and the software doing lexical analysis is called a lexical analyzer or scanner.

Multiple choice
  1. Deterministic context-free languages can be recognized by a deterministic turing machine.

  2. They are a proper subset of context-free languages.

  3. They can be accepted by a deterministic pushdown automaton.

  4. They are closed under union.

  5. They are closed under complement.

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

 DCFL is a subset of the complexity class SC. The set of deterministic context-free languages is not closed under union but is closed under complement.