Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

1. Which arranges for parameters to be bound on entering a procedure?
a) Form
b) Let
c) Initial
d) Parameter

View Answer

Answer: b [Reason:] LET arranges for parameters to be bound, just as parameter are bound on entering a procedure.

2. How does LET generally begins with?
a) Parameter list
b) Data
c) Fence
d) None of the mentioned

View Answer

Answer: a [Reason:] Parameter list consists of two-elements lists, each of which has a parameter variable and an intial value form.

3. What will happen if a variable had not assigned a value by SETF form?
a) Warning
b) Nothing will happen
c) Error message
d) Crash

View Answer

Answer: c [Reason:] Because of this condition, it will report an unbound variable error.

4. What is the alternative of LET for parameter binding?
a) Let
b) Let*
c) Let^
d) Let%

View Answer

Answer: b [Reason:] None.

5. Which helps you to write procedures on complicated things?
a) Development
b) Revoke
c) Progressive envelopment
d) All of the mentioned

View Answer

Answer: c [Reason:] Progressive envelopment helps you to write procedures on building complicated things incrementally.

6. What is the output of the given statement?

span class="sy0"> * (setf x 'outside)
* (let* ((x 'inside) (y x))(list x y))

a) Inside Outside
b) Outside Inside
c) Outside Outside
d) Inside Inside

View Answer

Answer: d [Reason:] X’s and Y’s parameter are on inside only, So it is printing as Inside Inside. Output: (INSIDE INSIDE)

7. What is the output of the given statement?

span class="sy0"> * (defun both_ends (whole-list) 
  (let ((element (first whole-list)) (trailer (last whole-list))) 
  (cons element trailer)))

a) Both
b) Both_ends
c) Error
d) None of the mentioned

View Answer

Answer: b [Reason:] Atfirst element and trailer are assigned to initial value and then element and trailer are combined. Output: BOTH_ENDS

8. What is the output of the given statement?

span class="sy0"> * (defun both (l m) (cons (first l) (last m)))
* (both '(breakfast lunch) '(tea dinner))

a) Breakfast Lunch
b) Tea Dinner
c) Breakfast
d) Breakfast Dinner

View Answer

Answer: d [Reason:] The purpose of both is to combine the first element of one list with the last element of another. Output: (BREAKFAST DINNER)

9. What is the output of the given statement?

span class="sy0"> * (setf route '(boston cambridge lincoln concord))
* (cons (last route))

a) Boston
b) Cambridge
c) Lincoln
d) Concord

View Answer

Answer: d [Reason:] This statement will print last element of the list. Output: (CONCORD)

10. What is the output of the given statement?

span class="sy0"> * (setf abc-list '(a b c))
* (last abc-list)
* (first (last abc-list))

a) A
b) B
c) C
d) None of the mentioned

View Answer

Answer: c [Reason:] This statement will nest function of last with the first. Output: C