Web development 101 : the ruby project


#1

i am doing the ruby project at the moment but when i try to implement bonus tasks then input rake ,
it doesn’t work and the code doesn’t get recognized by the rake.

here’s my code below:

#write your code here
def add (num_1, num_2)
return num_1 + num_2
end

def subtract (num_1, num_2)
return num_1 - num_2
end

def sum (arr)
sum = 0
for i in arr do
sum = sum + i
end
return sum
end

the functions bellow are not recognized

def multiply (arr)

sum = 1
for i in arr do
    sum = sum * i
end
return sum

end

def power (num, pow)
return num**pow
end

def factorial (num)
i = 1
fac = 1
while i <= num
fac = fac * i
i = i + 1
end

return fac

end


#2

Can you paste the actual output you get in the terminal?