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
-
a machine language
-
short for Beginner’s All-Purpose Symbolic Instruction Code
-
a high-level language
-
useful only for writing business programs
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.
-
assembly
-
machine
-
low-level
-
high-level
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.
-
English-like words
-
1s and 0s representing high and low electrical states
-
BASIC
-
Symbolic names to represent storage locations
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.
-
It translates one statement of high level language program to machine language and immediately execute it.
-
A translate which translates entire high level language to machine language and then executes it.
-
It executes the program only.
-
None of the above
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.
-
Lexical analysis
-
Syntax analysis
-
Code generation
-
None of these
C
Correct answer
Explanation
This phase of the compiler converts the intermediate code into a sequence of machine instructions.
-
Side by side execution
-
Enhancement parallel computing
-
Improved garbage collection
-
MEF
-
Dynamic language runtime
E
Correct answer
Explanation
This should be available for development.
-
Comman type security (CTS)
-
Common Language run time security (CLRS)
-
Base class library
-
Assembly language
-
Code access security (CAS)
E
Correct answer
Explanation
The source code of the assembly is taken as evidence to provide security in .NET framework. This feature is called CAS.
-
Common Language Specification
-
Programming Language Layer
-
VB.Net
-
C
-
Common Language Runtime
A
Correct answer
Explanation
CLS is a natural run time format.
-
MSIL
-
Compiler
-
CLS
-
CLR
-
None of the above
D
Correct answer
Explanation
This provides the run time environment to byte code, and it contains the converter.
-
N-version programming
-
Structured programming
-
Defensive programming
-
None of these
B
Correct answer
Explanation
Structured programming uses only while loop and control structures, but not goto statements.
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.
-
PostScript
-
AppleScript
-
JavaScript
-
Tcl
-
Perl
A
Correct answer
Explanation
PostScript (PS) is a computer language for creating vector graphics. It is a dynamically typed, concatenative programming language.
-
C
-
Fortran
-
BASIC
-
JAVA
-
COBOL
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.
-
Line reconstruction
-
Lexical analysis
-
Preprocessing
-
Syntax analysis
-
Semantic analysis
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.
-
Deterministic context-free languages can be recognized by a deterministic turing machine.
-
They are a proper subset of context-free languages.
-
They can be accepted by a deterministic pushdown automaton.
-
They are closed under union.
-
They are closed under complement.
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.