we just need to go through the test with him and ensure that in future he puts down some kind of answer to get at least a few marks per question
perhaps we should have suggested this to everyone before the test started say something like
if you put down any answer to questions you're unsure of more likely than not you'll pick up a few marks
i don't know why he'd even think to put () as a representation of an empty string
i noticed that he has trouble with doing what the question is explicitly asking for in the ruby fundamentals
if a question says pass these things in as arguments he struggles to actually do it
my_name = "Thomas"
puts my_name.reverse
do you think for this he should be getting at least 6 marks considering he might not even pass?
array_of_numbers = [12, 4, 10, 6, 7, 9, 11, 23, 33]
def find_position(array, int)
# index = int - 1 because arrays start at 0, most people wont know this, so I put it in so
# when someone puts 4 for example it will show the 4th value in the array and not the
# 5th value
index = int - 1
puts array[index]
end
the method returns nil so that has to be at least 5 marks off
didn't actually loop through the array
i think your comments are valid for yong to take in
perhaps for a question like this we should have example code like
arr = [12, 4, 10, 6, 7, 9, 11, 23, 33]
# create method here
p find_position(arr, 9)
=> 5
again a lot of his code is not quite to the point like using gets
to get the books
the way that he did the final price is correct final_price = total - total * - 0.25
20 marks is about right but could maybe be more like 25-30 based on other q15 attempts that i've seen
the main problem with this was the way that she passed in an empty array "[]" as an argument
the other problem is the in the sum she had
discount = price * (5/100)
=> 0
we need more like
32 - (32.0 * 5/100)
=> 30.4
maybe could we worth more like 20 marks instead of 15 considering the effort that went in
problems with return in this question but not a terrible effort
def my_method (array, number)
new_array = []
array.each do |pipe|
if pipe == number
new_array.push pipe
return true
else
return false
end
end
end
my_method [1,2,3], 2
again not doing what the question is explicitly asking for, where did it say create a new array?
big problems that i'm seeing is the use of return and not explicitly following what the question is asking for
he thought the question through and deserves 10 marks
not that much else to day though
no use of
total = price - (price * 0.05)
and no use of .uniq
a good use of a case statement to return the discount amount based on the number of unique books
but there is no actual reduction