logo

Crowdly

Browser

Add to Chrome

COMP 6411 AA 2251 (Summer 2025)

Looking for COMP 6411 AA 2251 (Summer 2025) test answers and solutions? Browse our comprehensive collection of verified answers for COMP 6411 AA 2251 (Summer 2025) at moodle.concordia.ca.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

In Haskell, what would the following expression produce?

5:4:3:2:1:[ ]

0%
0%
0%
0%
0%
View this question

Let's say that we are entering expressions in the Scheme repl (i.e., the  command line interpreter that always produces an output after an expression is evaluated. )

We first enter:

(define (foo x y)  (if (zero? (mod x y)) x      (sqrt y)  ))

(Note that mod is the name of the modulo function (i.e., remainder) in newer versions of Scheme, and sqrt is of course square root.)

This function is accepted by the repl and we then enter

(foo 16 4)

What would you expect the repl to display after foo is invoked? (note that no errors are produced by this code)

0%
0%
0%
0%
0%
View this question

In Scheme, how would we interpret the following?

'(A (B C))

0%
0%
0%
0%
0%
View this question

Which of the following statements are true? You may select more than one answer.

Incorrect answers will reduce the total score for the question, so you can not simply select all answers (your total score for the question can never be negative)

0%
0%
0%
0%
0%
View this question

Given the following notation:

Dog = Bird ° Rabbit

and the definitions:

Bird(foo) = foo + foo

Rabbit(foo) = (foo - 2) * 3

What result would we expect to get if we invoked:

Dog(4)

0%
0%
0%
0%
0%
View this question

The syntax

foo::[Int]->Int

would be interpreted as...

0%
0%
0%
0%
View this question

Which of the following statements is false?

View this question

Assuming that you have the code listed below:

(define (foo list1 list2)

 (cond

  ((null? list1) list2)

  (else

(cons (car list1)

(foo (cdr list1) list2)

)

)

  )

)

What would be the result when evaluating the following expression?

(foo '(4 5 6) '(a b c))

0%
0%
0%
0%
0%
View this question

What will the following Haskell code display (you can assume that the code works properly and print will output the result of the call to foo)

foo::[Int]->[Int]

foo [] = []

foo (a:b) = (foo b) ++ [a]

print(foo [5,6,7,8])

0%
0%
0%
0%
View this question

Which of the following statements is true?

Note that you may select more than one answer but incorrect answers will reduce the total score for the question (the final score will never be less than zero)

0%
0%
0%
0%
0%
View this question

Want instant access to all verified answers on moodle.concordia.ca?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome