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

What is a Turing machine?

  1. A mathematical model of computation that consists of a tape, a head, and a set of instructions.

  2. A physical device that can be used to perform computations.

  3. A programming language that is used to write programs for Turing machines.

  4. A software program that can be used to simulate Turing machines.

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

Turing machines are a theoretical model of computation that can be used to define the concept of computability.

Multiple choice

Which of these is NOT a common programming language taught in middle school technology classes?

  1. Python

  2. Java

  3. Scratch

  4. C++

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

C++ is generally not introduced in middle school technology classes due to its complexity and advanced concepts.

Multiple choice

What is the primary purpose of an assembler in microprocessor programming?

  1. Converting high-level language code into machine code

  2. Translating assembly language instructions into binary code

  3. Optimizing the performance of machine code

  4. Managing the allocation of memory resources

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

An assembler translates assembly language instructions, which are human-readable representations of machine code, into binary code that can be executed by the microprocessor.

Multiple choice

What is the role of a compiler in microprocessor programming?

  1. Translating high-level language code into assembly language

  2. Converting assembly language instructions into binary code

  3. Optimizing the performance of machine code

  4. Managing the allocation of memory resources

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

A compiler translates high-level language code, such as C or Python, into assembly language, which is a low-level language closer to machine code.

Multiple choice

What programming language is primarily used for developing Fuchsia applications?

  1. Java

  2. Swift

  3. Kotlin

  4. C++

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

Fuchsia applications are primarily developed using C++, although other languages, such as Rust and Go, are also supported.

Multiple choice

What is the most common type of robot programming?

  1. Teach pendant programming

  2. Offline programming

  3. Adaptive programming

  4. Sensor-based programming

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

Teach pendant programming is the most common type of robot programming.

Multiple choice

Which of the following is NOT a type of robot programming language?

  1. Karel

  2. VAL

  3. Python

  4. C++

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

Python is not a type of robot programming language.

Multiple choice

What is the primary programming language used for developing Firefox OS apps?

  1. JavaScript

  2. Java

  3. C++

  4. Python

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

Firefox OS apps are primarily developed using JavaScript, which allows for cross-platform compatibility and easy integration with web technologies.

Multiple choice

What was the primary programming language used to develop Palm OS applications?

  1. C++

  2. Java

  3. Python

  4. Objective-C

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

C++ was the primary programming language used to develop Palm OS applications.

Multiple choice

Which NLP library is commonly used for natural language generation (NLG) tasks?

  1. spaCy

  2. NLTK

  3. TextBlob

  4. OpenAI GPT-3

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

OpenAI GPT-3 is a large-scale language model developed by OpenAI, known for its impressive natural language generation capabilities. It can generate coherent and human-like text, making it useful for various NLG tasks such as text summarization, dialogue generation, and machine translation.

Multiple choice

In NumPy, which function is used to compute the determinant of a matrix?

  1. linalg.det()

  2. linalg.inv()

  3. linalg.norm()

  4. linalg.solve()

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

The linalg.det() function in NumPy is used to calculate the determinant of a square matrix.

Multiple choice

In Eigen, which function is used to compute the eigenvalues and eigenvectors of a matrix?

  1. eigenSolver()

  2. svd()

  3. lu()

  4. qr()

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

The eigenSolver() function in Eigen is used to compute the eigenvalues and eigenvectors of a matrix.

Multiple choice

In Julia's LinearAlgebra package, which function is used to compute the determinant of a matrix?

  1. det()

  2. inv()

  3. norm()

  4. solve()

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

The det() function in Julia's LinearAlgebra package is used to calculate the determinant of a square matrix.

Multiple choice

In MATLAB's Linear Algebra Toolbox, which function is used to compute the eigenvalues and eigenvectors of a matrix?

  1. eig()

  2. svd()

  3. lu()

  4. qr()

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

The eig() function in MATLAB's Linear Algebra Toolbox is used to compute the eigenvalues and eigenvectors of a matrix.

Multiple choice

In R's Matrix package, which function is used to compute the determinant of a matrix?

  1. det()

  2. inv()

  3. norm()

  4. solve()

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

The det() function in R's Matrix package is used to calculate the determinant of a square matrix.