Questions & Results
Q1 of 6Multiple ChoiceAccuracy60s · 1 pt
What is the value of the OCaml expression if 3 = 5 then 10 else 20
13 / 17 answered · 92% correct
Q2 of 6Multiple ChoiceAccuracy60s · 1 pt
What is the type of the following expression?
if true then 10 else 20
7 / 17 answered · 100% correct
Q3 of 6Multiple ChoiceAccuracy60s · 1 pt
What happens when OCaml evaluates the following expression?
if 10=5 then "yes" else 0
D It produces a type error✓ Correct 1 / 17 answered · 0% correct
Q4 of 6Multiple ChoiceAccuracy60s · 1 pt
What is the type of the OCaml function?
let f x = x + 1
0 / 17 answered
Q5 of 6Multiple ChoiceAccuracy59s · 1 pt
What is the type of the OCaml function?
let f x y = (x = y)
B 'a -> 'a -> bool✓ Correct 0 / 17 answered
Q6 of 6Multiple ChoiceAccuracy60s · 1 pt
What does the following OCaml function compute?
let rec f n =
if n = 0 then 0
else n + f (n - 1)
B The sum of integers from 1 to n✓ Correct D The number of integers from 0 to n 1 / 17 answered · 0% correct
Score Distribution
Score (points) →