Please answer the following multiple choice questions: 1) Which best describes a
ID: 3599307 • Letter: P
Question
Please answer the following multiple choice questions:
1) Which best describes a procedural programming language?
Languages with scope.
Languages that do not have variables that can change once their value is set.
Languages that have control structures like if/else and for.
Languages that allow for calling other portions of code.
2) When organizing the actions of several programs it is often useful to write programs using:
Shell scripting
C
Java
Haskell
3) What is the purpose of pointers?
Pointers allow you to access many elements of the data through a single variable name.
Pointers allow programmers to use data on the stack.
Pointers allow different sections of a program to have access to the same memory.
Two of the above.
4) Where do local variables have their memory placed by compilers (in most langauges)?
On the CPU.
In the cache.
On the stack.
On the heap.
5) What is a result of the above? (Assume correct answer for #5)
The stack requires more space than the heap in most programs.
CPU performance is dictated by the number of variables you define.
Programming languages require the programmer to understand their implementation.
Variables have limited scope.
6) Why would an organization choose to write an application in Java?
It is capable of running on multiple platforms without rewriting the code.
It is capable of implementing very large software projects because of its design features.
It has a large number of libraries built in that simplify many tasks.
All of the above.
Explanation / Answer
1) Which best describes a procedural programming language?
Languages with scope.
Languages that do not have variables that can change once their value is set.
Languages that have control structures like if/else and for.
Languages that allow for calling other portions of code.
There are OO langauges also which allow if else loops, calling other code and have variables that can't be changed (Example Java)
2) When organizing the actions of several programs it is often useful to write programs using:
Shell scripting
C
Java
Haskell
Shell can run multiple programs and can pipe them together
3) What is the purpose of pointers?
Pointers allow you to access many elements of the data through a single variable name.
Pointers allow programmers to use data on the stack.
Pointers allow different sections of a program to have access to the same memory.
Two of the above.
Pointers allow programmers to use data on the stack.
Pointers allow different sections of a program to have access to the same memory.
4) Where do local variables have their memory placed by compilers (in most langauges)?
On the CPU.
In the cache.
On the stack.
On the heap.
Local variables are on stack and have limited scope
5) What is a result of the above? (Assume correct answer for #5)
The stack requires more space than the heap in most programs.
CPU performance is dictated by the number of variables you define.
Programming languages require the programmer to understand their implementation.
Variables have limited scope.
6) Why would an organization choose to write an application in Java?
It is capable of running on multiple platforms without rewriting the code.
It is capable of implementing very large software projects because of its design features.
It has a large number of libraries built in that simplify many tasks.
All of the above