Question 4 1 point Select all of the following statements th

Question 4 (1 point)

Select all of the following statements that are true.

Question 4 options:

A \"strong type system\" is described as one in which there is no possibility of an unchecked run-time type error. In other words, the absence of unchecked run-time errors is referred to as safety or type safety

Type checking determines whether and when types are verified. Static checking means that type errors are reported based on a program\'s text (source code). Dynamic checking means that type errors are reported based on a program\'s dynamic (run-time) behavior.

Some programming languages do not have static type-checking. In many such languages, it is easy to write programs which would be rejected by most static type-checkers. For example, a variable might store either a number or the Boolean value \"false\". Some programmers refer to these languages as \"weakly typed\", since they do not seem to enforce the \"strong\" type discipline found in a language with a static type-checker.

If simple operations do not behave in a way that one would expect, a programming language can be said to be \"weakly typed\". For example, consider the following program:

x = \"5\" + 6


Different languages will assign a different value to x:

One language might convert 6 to a string, and concatenate the two arguments to produce the string \"56\" (e.g. JavaScript)


Another language might convert \"5\" to a number, and add the two arguments to produce the number 11 (e.g. Perl, PHP)


Yet another language might represent the string \"5\" as a pointer to the first character of the string within memory, and add 6 to that pointer to produce another address (e.g. C)


And yet another language might simply fail to compile this program or report run-time errors saying that the two operands have incompatible type (e.g. Ruby, Python, BASIC)

Save

Question 5 (1 point)

Select all of the following statements that are true.

Question 5 options:

Multiple consecutive whitespace characters (such as spaces, tabs, and new lines) outside literal quotations have meaning in Scheme programs.

Every algorithm or problem solution we could describe using Python can also be described in Scheme.

The Python statement x = 1 will act like Scheme\'s (define x 1) if there is no storage location already namedx.

Scheme is designed primarily for a functional programming style. This means most of a Scheme program is applying and defining functions. Python is designed primarily for an imperative programming style.

Question 6 (1 point)

Select all of the following statements that are true.

Question 6 options:

The Scheme statements,

(define lst (list 10 20 30))
(car (cdr (cdr lst)))

are equivalent to the Python statements,

Like Scheme, Python has latent (invisible) types that are checked dynamically.

The Scheme statement,

(define square (lambda (x) (* x x)))

is equivalent to the Python statement,

The Scheme statement,

(lambda (a b) (+ a b))

is equivalent to the Python statement,

lambda a, b: a + b

A)

A \"strong type system\" is described as one in which there is no possibility of an unchecked run-time type error. In other words, the absence of unchecked run-time errors is referred to as safety or type safety

       
B)

Type checking determines whether and when types are verified. Static checking means that type errors are reported based on a program\'s text (source code). Dynamic checking means that type errors are reported based on a program\'s dynamic (run-time) behavior.

C)

Some programming languages do not have static type-checking. In many such languages, it is easy to write programs which would be rejected by most static type-checkers. For example, a variable might store either a number or the Boolean value \"false\". Some programmers refer to these languages as \"weakly typed\", since they do not seem to enforce the \"strong\" type discipline found in a language with a static type-checker.

D)

If simple operations do not behave in a way that one would expect, a programming language can be said to be \"weakly typed\". For example, consider the following program:

x = \"5\" + 6


Different languages will assign a different value to x:

One language might convert 6 to a string, and concatenate the two arguments to produce the string \"56\" (e.g. JavaScript)


Another language might convert \"5\" to a number, and add the two arguments to produce the number 11 (e.g. Perl, PHP)


Yet another language might represent the string \"5\" as a pointer to the first character of the string within memory, and add 6 to that pointer to produce another address (e.g. C)


And yet another language might simply fail to compile this program or report run-time errors saying that the two operands have incompatible type (e.g. Ruby, Python, BASIC)

Solution

Answer 4 a b d are true option c is false

Answer 5 a b d are true option c is false

Answer 6 b d are true option a c are false

Question 4 (1 point) Select all of the following statements that are true. Question 4 options: A \
Question 4 (1 point) Select all of the following statements that are true. Question 4 options: A \
Question 4 (1 point) Select all of the following statements that are true. Question 4 options: A \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site