Cody

Solution 2077771

Submitted on 3 Jan 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
words = {'hello','there','fellow','matlab','users'}; score = 43; assert(isequal(scrabble_scores_2(words),score))

score = 8 8 12 10 5

Assertion failed.

2   Fail
words = {'what','do','you','think','of','this','problem'}; score = 56; assert(isequal(scrabble_scores_2(words),score))

score = 10 3 6 12 5 7 13

Assertion failed.

3   Fail
words = {'if','you','like','it','please','give','it','a','like'}; score = 48; assert(isequal(scrabble_scores_2(words),score))

score = 5 6 8 2 8 8 2 1 8

Assertion failed.

4   Fail
words = {'zither','quandry','flummox','wealthy','amalgam'}; score = 87; assert(isequal(scrabble_scores_2(words),score))

score = 18 20 21 16 12

Assertion failed.

5   Fail
words = {'one','two','three','four','five'}; score = 34; assert(isequal(scrabble_scores_2(words),score))

score = 3 6 8 7 10

Assertion failed.

6   Pass
words = {'heterogeneous','homogenously','concatenate','thusly','hi'}; score = [17 21 15 12 5]; ind = randi(5); assert(isequal(scrabble_scores_2(words(ind)),score(ind)))

score = 21

7   Pass
words = {'perspicacious','yes','zero','quizzical','no'}; score = [21 6 13 38 2]; ind = randi(5); assert(isequal(scrabble_scores_2(words(ind)),score(ind)))

score = 13

8   Fail
words = {'the quick brown fox jumps over a lazy dog'}; score = 94; assert(isequal(scrabble_scores_2(words),score))

Unable to perform assignment because the left and right sides have a different number of elements. Error in scrabble_scores_2 (line 17) score(w) = score(w) + str2num(x(i)); Error in Test8 (line 3) assert(isequal(scrabble_scores_2(words),score))

9   Fail
words = {'the','quick','brown','fox','jumps','over','a','lazy','dog'}; score = 94; assert(isequal(scrabble_scores_2(words),score))

score = 6 20 10 13 16 7 1 16 5

Assertion failed.

Suggested Problems

More from this Author139