This set of LISP Multiple Choice Questions & Answers (MCQs) focuses on “Procedure Abstraction”.
1. Which process helps to build large and complicated programs?
a) Macros
b) Procedure abstraction
c) Defun
d) None of the mentioned
View Answer
Explanation: Procedure abstraction process helps to build large and complicated programs and it is easy to understand.
2. Which abstractions have a prescribed behavior?
a) Auxiliary procedures
b) Procedure abstraction
c) Primary procedures
d) None of the mentioned
View Answer
Explanation: Auxiliary procedures will help to produce a proper result and it will have a prescribed behavior.
3. What is the process of arranging procedures into layers?
a) Procedure
b) Abstraction
c) Abstraction layers
d) Procedure abstraction
View Answer
Explanation: Abstraction layers helps to arrange procedures into layers.
4. Which is used to seperate the abstraction layers?
a) Abstraction boundaries
b) Data
c) Procedure
d) All of the mentioned
View Answer
Explanation: Abstraction boundaries help to keep abstraction layers separate from each other.
5. Which hides details behind abstraction boundaries?
a) Procedures
b) Procedure abstraction
c) Recursion
d) Both Procedures & Procedure abstraction
View Answer
Explanation: Procedure abstraction hides details behind abstraction boundaries and it is increase the security between layers.
6. What is the output of the following statement?
*(setf thing 'sphere r 1) * (cond ((eq thing 'circle) (* pi r r)) ((* 4 pi r r)))
a) 10.566
b) 11.5683
c) 12.56637
d) 13
View Answer
Explanation: This statement will help to find the area of sphere.
Output:
12.566370614359172d0
7. What is the output of the following statement?
span class="sy0"> * (setf p .6) * (cond ((> p .75) 'very-likely)((> p .5) 'likely)((> p .25) 'unlikely)(t 'very-unlikely))
a) Very-likely
b) Likely
c) Unlikely
d) Very-unlikely
View Answer
Explanation: As the value p is .6, it is printing likely.
Output:
LIKELY
8. What is the output of the following statement?
span class="sy0"> * (setf thing 'point r 1) * (case thing (circle (*pi r r))(sphere (* 4 pi r r)))
a) 1
b) 12.56637
c) NIL
d) T
View Answer
Explanation: As the value is not matched, it is printing as NIL.
Output:
NIL
9. What is the output of the following statement?
span class="sy0"> * (setf breakfast '(eggs bacon toast tea)) * (cond ((> (length breakfast) 10) 'glutton) ((not (endp breakfast)) 'normal)(t 'anorexic))
a) Anorexic
b) Breakfast
c) Eggs
d) Normal
View Answer
Explanation: As breakfast is not empty, It is printing normal.
Output:
NORMAL
10. What is the output of the following statement?
span class="sy0"> * (setf thing 'point r 1) * (case thing (circle (*pi r r))(sphere (* 4 pi r r)) (otherwise 0))
a) 1
b) 0
c) 12.566
d) None of the mentioned
View Answer
Explanation: Otherwise is like else statement, So it is printing 0.
Output:
0
Sanfoundry Global Education & Learning Series – LISP Programming Language.
To practice all areas of LISP, here is complete set of 250+ Multiple Choice Questions and Answers on LISP Programming Language.
- Check LISP Books
- Practice Computer Science MCQs
- Check Computer Science Books
- Apply for Computer Science Internship