Search Header Logo

Quiz on Declarative and Imperative Programming Languages

Authored by Nurmanap Kolohanov

Computers

12th Grade

Used 10+ times

Quiz on Declarative and Imperative Programming Languages
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is declarative programming?

A programming paradigm that uses loops extensively

A programming paradigm focused on changing program state

A programming paradigm that expresses the logic of a computation

A programming paradigm that describes how to perform tasks

Answer explanation

Declarative programming focuses on expressing the logic of a computation without detailing the control flow. This contrasts with imperative programming, which describes how to perform tasks step by step.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an example of a declarative language?

Java

Prolog

Python

C++

Answer explanation

Prolog is a declarative programming language, focusing on logic and facts rather than control flow. In contrast, Java, Python, and C++ are imperative languages that require explicit instructions for execution.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does imperative programming focus on?

How the program should achieve the result

What the program should accomplish

The efficiency of the program

The structure of the programming language

Answer explanation

Imperative programming focuses on how to achieve a result by specifying the steps or commands to be executed. This contrasts with declarative programming, which emphasizes what the program should accomplish.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a characteristic of declarative programming?

Focuses on how to achieve results

Provides less flexibility

Simplifies the program

Expresses logic without control flow

Answer explanation

Declarative programming emphasizes what the program should accomplish rather than how to achieve it. Therefore, the statement 'Focuses on how to achieve results' is NOT a characteristic of declarative programming.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a key feature of imperative programming?

Uses a knowledge base

Focuses on what the program should accomplish

Changes program state through statements

Is less complex than declarative programming

Answer explanation

A key feature of imperative programming is that it changes program state through statements. This means it focuses on how to achieve a result by executing a sequence of commands, unlike declarative programming which describes what to accomplish.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following languages is considered imperative?

HTML

Haskell

SQL

PHP

Answer explanation

PHP is considered an imperative programming language because it allows for commands to be executed in a specific order, enabling developers to control the flow of execution. In contrast, HTML, Haskell, and SQL are not imperative.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the term 'execution is not clearly delineated' refer to in declarative programming?

The program is executed in a single step

The order of instructions is well-defined

The execution order is not explicitly stated

The program's control flow is easy to understand

Answer explanation

In declarative programming, 'execution is not clearly delineated' means that the execution order of instructions is not explicitly stated, allowing the underlying system to determine how to execute the program.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?