I need someone that is fairly proficient at lisp, ruby, and prolog. But I understand if you are not good at one if you are at least good at two of those that work too. If you are a good coder this is very easy money cause there is no coding just multiple choice. I need someone available today at 2pm EST (NYC time)
18) in Ruby, attr_access defines class attributes that other classes can:
Select one:
a.
only set
b.
only get
c.
Both get and set
d.
access only but not set
e.
none of the options
19) In Ruby, the following line:
attr_writer: x
Is exactly equivalent in effect and usage to which of the following code snippets?
Select one:
a.
b.
c.
d.
None of the options
20) In Ruby, multiple initializers are allowed by default, correct?
Select one:
a.
No, and will return an error as only one initializer is allowed
b.
No, but error will happen only if you reference an initializer other
than the last one
c.
Yes, just like constructors in most of OOP languages
d.
None of the options
e. No, but error will only be captured at runtime
21)In Ruby, What’s the value of arr[-1] for the following array:
arr = [1, 2, 3, 4]
Select one:
a.
-ve Sign is ignored and it will access arr[1] = 2
b.
3
c.
4
d.
As in other similar languages, it will result in an error as index cannot be negative
e.
1
f.
none of the options
22) In Ruby, which of the answers is equivalent to the following snippet:
Select one:
a.
None of the options
b.
c.
All the options
d.
e.
f.
23)
Select one:
a.
15
b.
25
c.
55
d.
None of the options
e.
Syntax error
f.
5
18) in Ruby, attr_access defines class attributes that other classes can:
Select one:
a.
only set
b.
only get
c.
Both get and set
d.
access only but not set
e.
none of the options
19) In Ruby, the following line:
attr_writer: x
Is exactly equivalent in effect and usage to which of the following code snippets?
Select one:
a.
b.
c.
d.
None of the options
20) In Ruby, multiple initializers are allowed by default, correct?
Select one:
a.
No, and will return an error as only one initializer is allowed
b.
No, but error will happen only if you reference an initializer other
than the last one
c.
Yes, just like constructors in most of OOP languages
d.
None of the options
e. No, but error will only be captured at runtime
21)In Ruby, What’s the value of arr[-1] for the following array:
arr = [1, 2, 3, 4]
Select one:
a.
-ve Sign is ignored and it will access arr[1] = 2
b.
3
c.
4
d.
As in other similar languages, it will result in an error as index cannot be negative
e.
1
f.
none of the options
22) In Ruby, which of the answers is equivalent to the following snippet:
Select one:
a.
None of the options
b.
c.
All the options
d.
e.
f.
23)
Select one:
a.
15
b.
25
c.
55
d.
None of the options
e.
Syntax error
f.
5
24) Method overloading in Ruby is:
Select one:
a.
None of the options
b.
Not supported, last method will be executed and will not result in any error
c.
Not supported but error only captured at runtime
d.
Not supported and causes a compilation error
e.
Generally supported like other languages
25) Ruby is an OOP language that is:
Select one:
a.
none of the options
b.
Dynamically typed and in which almost everything is an object even literals!
c.
Statically typed and in which almost everything is an object except literals!
d.
Statically typed and in which almost everything is an object even literals!
e.
Dynamically typed and in which almost everything is an object except literals!
26) What could be the right output for the following snippet?
Select one:
a.
1, 1
0xffffcbec, 0xffffcbec
b.
1, 0
0xffffcbec, 0xffffcbec
c.
none of the options
d.
1, 1
0xffffcbec, 0xffffcbbb
e.
1, 1
0xffffcbbb, 0xffffcbec
f.
1, 0
0xffffcbec, 0xffffcbbb
27) What is the correct base case for the following function which returns the right most
node in a tree?
Select one:
a.
b.
None of the options
c.
d.
28) What is the output of the following Ruby code snippet?
Select one:
a.
[2, 3, 6]
b.
[2, 3, 4]
c.
None of the options
d.
[2, 3, 3]
e.
[1, 2, 3]
f.
[2, 2, 3]
29)
Select one:
a.
123123
b.
Compilation error
c.
246
d.
“123123”
e.
none of the options
f.
“123″123””
33) Which of the following Ruby’s introspection allows us to find:
Select one:
a.
Instance methods
b.
Object’s ID
c.
Object’s class
d.
All the options
e.
Instance variables
15) In comparison between C and Ruby, all the following is correct EXCEPT:
Select one:
a.
Both C & Ruby are not purely functional programming
b.
C is imperative non-OOP while Ruby is pure OOP
c.
C is statically typed while Ruby is dynamically typed
d.
C include directive is similar to Ruby include keyword
e.
There are no exceptions and all are options correct
16) In C, pointers can be used for all the following EXCEPT?
Select one:
a.
Passing by value
b.
Passing by reference
c.
Variables Aliases
d.
None of the options
e.
Array pointers
f.Function pointers
17) In C, the following indicates that the variable/method:
Select one:
a.
extern: is defined in the current file and it is visible in other files.
static: is defined outside the current file
no modifier (default): is visible only from within the file it is defined in
b.
extern: is defined outside the current file
static: is visible only from within the file it is defined in
no modifier (default): is defined in the current file and it is visible in other files.
c.
extern: is visible only from within the file it is defined in
static: is defined in the current file and it is visible in other files
no modifier (default): is defined outside the current file
d.
extern: is defined outside the current file
static: is defined in the current file and it is visible in other files
no modifier (default): is visible only from within the file it is defined in
e.
none of the options
30) What is the result of following segment of Lisp code:
Select one:
a.
None of the options
b.
syntax error since z has no value
c.
24
d.
16
e.
36
f.
14
31)
Select one:
a.
None of the options
b.
result in compiler error
c.
swap variables a&b and prints out the new swapped values
d.
will not swap the values because a&b were passed by value not by reference
e.
will not swap the values because temp is not defined as an integer pointer
32) Which of the following is NOT a valid way of accessing the second array element?
Select one:
a.
*(&array[1])
b.
All the options are valid and there is nothing invalid
c.
array[1]
d.
*(array +1)
e.
*(array[0]+1)
34) Which of the following set of rules will produce X=9 for the following query:
Select one:
a.
b.
c.
None of the options
d.
e.
36) Which of the following statements is NOT true about the cut “!”:
Select one:
a.
It is used to prevent unwanted backtracking
b.
a way to prevent Prolog from finding all possible solutions
c.
It is added to improve the efficiency.
d.
All options are correct and nothing is untrue
e.
It’s simply a special atom that we can use when writing clauses.
38) Which of the following statements would result in a compiler error?
Select one:
a.
b.
c.
d.
e.
30) What is the result of following segment of Lisp code:
Select one:
a.
None of the options
b.
syntax error since z has no value
c.
24
d.
16
e.
36
f.
14
31)
Select one:
a.
None of the options
b.
result in compiler error
c.
swap variables a&b and prints out the new swapped values
d.
will not swap the values because a&b were passed by value not by reference
e.
will not swap the values because temp is not defined as an integer pointer
32)
Which of the following is NOT a valid way of accessing the second array element?
Select one:
a.
*(&array[1])
b.
All the options are valid and there is nothing invalid
c.
array[1]
d.
*(array +1)
e.
*(array[0]+1)
33)
Which of the following Ruby’s introspection allows us to find:
Select one:
a.
Instance methods
b.
Object’s ID
c.
Object’s class
d.
All the options
e.
Instance variables
39)
Select one:
a.
b.
c.
d.
e.
f.
g.
none of the options
* COMP-348-2204-E: Final Exam D x +
tent x
COMP348 W/2021 FINAL EXAM | X
concordia.ca/moodle/mod/quiz/attempt.php?attempt=2051583&cmid=2719903&page=4
DIA courses
Academic Integrity
English (en)
Sall. is uenreu mi me current me dnu il TS Visivi ili umel mes
no modifier (default): is visible only from within the file it is defined in
O e none of the options
Question 18
in Ruby, attr_access defines class attributes that other classes can:
Not yet
answered
Select one:
O a only set
Marked out of
1.00
Ob only get
Flag question
O C. Both get and set
od access only but not set
O e, none of the options
Question 19
In Ruby, the following line:
*
Not yet
attr_writer. x
answered
is exactly equivalent in effect and usage to which of the following code snippets?
Marked out of
1.00
Select one:
Flag question
С а.
def x (x)
@x = x
end
b
ie setX )
earch
O BI