Why are there so many iterative structures and what is the purpose of each. Think about looping and why different ones exist and why you can't have just one.
What is a multi dimensional arrays. What purposes can you think of for multi dimensional arrays.© BrainMass Inc. brainmass.com October 24, 2018, 7:37 pm ad1c9bdddf
Solution clearly explains the programming concepts and the purpose of Arrays, Multi-dimensional Arrays, Iterative structures like loops.
Programming Languages - M/C & T/F
1. The _______ of a variable is its ________.
a. address; l-value
b. value; r-value
c. address; r-value
d. value; l-value
e. a and b
f. c and d
2. When a variable's type is determined through default conventions,
the type declaration is:
3. The goto statement is the basis for the:
a. break statement in a C switch structure.
b. exit statement in an FORTRAN 90 loop structure.
c. last statement in a Perl loop structure.
d. All of the above.
e. None of the above.
4. An advantage of dynamic scoping is that access to nonlocal variables
is considerably faster than accesses to nonlocals when static scoping
5. The idea of providing a few basic data types and methods for
programmers to design data structures to meet their needs was
d. ALGOL 68
a. can be detected and reported at runtime.
b. cannot be detected, resulting in aberrant execution.
c. results in the type of the LHS being changed to match.
d. none of the above.
7. A given variable's storage bindings are determined at runtime but
its data type is bound prior to runtime. This type of variable is
8. ALGOL 60 introduced __________, which has been copied by most
imperative languages and many non-imperative languages.
a. static scope
b. dynamic scope
c. stack-dynamic scope
d. heap-dynamic scope
9. _________ is based on the calling sequence of subprograms.
a. Dynamic scope
b. Static scope
c. Stack-dynamic scope
d. Heap-dynamic scope
10. A(n) __________ is the collection of attributes of a variable.
a. abstract data type
11. Associativity in common imperative languages is left to right.
12. Programmers can alter associativity and precedence rules by:
a. overloading operators.
b. defining constants.
c. managing heap allocation/deallocation.
d. using parenthesis.
13. The simplest of all data types is:
14. When an array's subscript ranges are determined at compile time,
but the allocation is done at runtime, the array is:
b. fixed stack-dynamic.
15. If every element of a list must be processed, a(n) ___________ is
more efficient than a(n) __________.
a. hash; array
b. array; hash
c. record; array
d. hash; record
16. A pointer that contains the address of a heap-dynamic variable that
has been deallocated is called:
a. a dangling pointer.
c. lost pointer.
d. inaccessible variable.
17. Selection statements fall into two general categories, two-way and
n-way, or single-way selection.
18. When the result of an expression is determined without evaluating
all of the operands or operators, the evaluation is said to be:
d. none of the above.
19. When selection must be based on a Boolean expression, the best
approach is a(n) ___________ control structure.
d. b or c, depending on the language
20. An iterative statement is one that causes a statement or collection of
statements to be executed one or more times.
21. When the number of iterations is dependent on the number of
_______ control structure.
22. Using the precedence rules of APL, the value of the expression
24 x 3 + 1 is 73.
23. When two pointer variables point to the same memory location, they
are said to be:
24. The association of an entity and an attribute that is done before
runtime and does not change during execution is a:
a. dynamic binding.
b. dynamic linking.
c. static binding.
d. static linking.
25. If a mathematical operation is associative, then the corresponding
floating-point operation is associative.