Which of the following is NOT considered declarative?

Python
Python

HTML
HTML

CSS
CSS

SQL
SQL
Question 2
Which of the following is considered imperative?(2 points)
Responses

Pascal
Pascal

C++
C++

Python
Python

All of the above
All of the above
Question 3
What makes JavaScript an interesting language in terms of imperative vs declarative?(2 points)
Responses

The question is a false premise. JavaScript is not interesting.
The question is a false premise. JavaScript is not interesting.

JavaScript is strictly declarative, unless you use some sort of JavaScript library.
JavaScript is strictly declarative, unless you use some sort of JavaScript library.

JavaScript is the primary language for web development.
JavaScript is the primary language for web development.

JavaScript can be both imperative or declarative, depending on how it is used.

1 answer

Here are the answers to your questions:

Question 1: Which of the following is NOT considered declarative?

  • Answer: Python
    Python is primarily a general-purpose, imperative programming language. While it can be used in a declarative style in some contexts (like defining functions or using certain libraries), it is not inherently declarative like HTML, CSS, or SQL.

Question 2: Which of the following is considered imperative?

  • Answer: All of the above
    Pascal, C++, and Python can all be used in an imperative programming style, where you explicitly define the steps to achieve a result.

Question 3: What makes JavaScript an interesting language in terms of imperative vs declarative?

  • Answer: JavaScript can be both imperative or declarative, depending on how it is used.
    JavaScript allows for both programming paradigms; you can write imperative code using loops and conditionals, or use declarative paradigms, especially with libraries and frameworks that promote a more declarative style, such as React.