Question
Select all of the following statements that are true. 1. It is usually impractical or impossible to write system software for von Neumann architecture computers
Select all of the following statements that are true.
1. It is usually impractical or impossible to write "system software" for von Neumann architecture computers without the use of pointers to access memory.
2. To quote Donald Knuth, "Beware of bugs in the above code; I have only proved it correct, not tried it." (http://www-cs-faculty.stanford.edu/~knuth/faq.html) Programming languages exist that can prove incontrovertibly that non-trivial programs are correct and therefore bug-free.
3. Programming languages that maximize individual programmer productivity do not always maximize the aggregate productivity of a team of programmers.
4. High level programming languages were created to increase programmer productivity and thereby minimize the cost and schedule of software development
5. The following two C code blocks are logically equivalent:
{ // Code block 1
int incr = 1;
int sum = 0;
while(incr < 20) {
while(sum <= 100) {
sum += incr;
}
incr++;
}
printf("%d ", sum);
}
{ // Code block 2
int incr = 1;
int sum = 0;
loop1: if(incr >= 20) goto out;
loop2: if(sum > 100) goto next;
sum += incr;
goto loop2;
next: incr++;
goto loop1;
out:
printf("%d ", sum);
}
6. Edsger Dijkstra's letter, "Go To Statement Considered Harmful," published in the March 1968 Communications of the ACM (CACM), criticized the excessive use of the GOTO statement in programming languages of the day and advocated structured programming instead.
7. The C programming language is effectively a portable "Systems Programming" language.
8. Scheme was developed at MIT in the 1970s and is characterized by small size and its treatment of functions as "first-class entities". As first-class entities, functions can be values of expressions, elements of lists, assigned to variables, passed as parameters, and returned as value.
9. Some programming languages expose pointers as if they were numeric values and allow users to perform arithmetic on them. These languages are sometimes referred to as "weakly typed", since pointer arithmetic can be used to bypass the language's type system.
10. Java compiles source code into Byte Code. Byte Code may be interpreted or translated on the fly (Just In Time Compiled) into machine code.
11. Some programming languages are not Turing Complete.
12. Some programming languages can be interpreted or compiled on a case by case basis.
13. 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.
14. 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)
15. 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.
16. 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
17. Every Algorithm or problem solution we could describe using Python can also be described in Scheme.
18. Multiple consecutive whitespace characters (such as spaces, tabs, and new lines) outside literal quotations have meaning in Scheme programs.
19. 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.
20. The Python statement x = 1 will act like Scheme's (define x 1) if there is no storage location already named x.
21. Like Scheme, Python has latent (invisible) types that are checked dynamically.
22. The Scheme statement,
(lambda (a b) (+ a b))
is equivalent to the Python statement,
lambda a, b: a + b
23. The Scheme statement,
(define square (lambda (x) (* x x)))
is equivalent to the Python statement,
def square (x):
return x * x
24. The Scheme statements,
(define lst (list 10 20 30))
(car (cdr (cdr lst)))
are equivalent to the Python statements,
lst = [10, 20, 30]
print lst[2]
25. In Python, a dictionary is a list of (key, value) pairs. The key can be any "immutable" object (tuples, strings, numbers), and the value can be any Python object.
26. The following Racket function, func, is functionally identical to the Scheme standard map function. The type of the parameter f can be any valid Scheme type.
(define (func f lst)
(cond
[(empty? lst) empty]
[else (cons (f (first lst)) (func f (rest lst)))]
)
)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started