Quiz on Declarative and Imperative Programming Languages

Quiz on Declarative and Imperative Programming Languages

12th Grade

15 Qs

quiz-placeholder

Similar activities

Programming Basics, Unit 10 Review

Programming Basics, Unit 10 Review

9th - 12th Grade

15 Qs

Wiltshire General Knowledge

Wiltshire General Knowledge

12th Grade

16 Qs

Database Quiz 6 Big Data Quiz

Database Quiz 6 Big Data Quiz

12th Grade

12 Qs

Topical Test 1 - Introduction to Programming

Topical Test 1 - Introduction to Programming

12th Grade

20 Qs

Technical Quiz Round 2

Technical Quiz Round 2

12th Grade

10 Qs

A Level Computing 1.2.4a Programming Paradigms

A Level Computing 1.2.4a Programming Paradigms

12th Grade

15 Qs

Topic 1.2 Paradigms of Programming Language

Topic 1.2 Paradigms of Programming Language

12th Grade

12 Qs

1.2.4 Types of Programming Language

1.2.4 Types of Programming Language

12th Grade

15 Qs

Quiz on Declarative and Imperative Programming Languages

Quiz on Declarative and Imperative Programming Languages

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Nurmanap Kolohanov

Used 6+ times

FREE Resource

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.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?