Cody

Solution 2117746

Submitted on 4 Feb 2020 by Asif Newaz
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   Pass
filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext,'eval'))) assert(isempty(strfind(filetext,'echo'))) assert(isempty(strfind(filetext,'switch')))

2   Pass
assert(isequal(your_fcn_name('Hello world'),5.000))

p = 1×2 cell array {'Hello'} {'world'} a = 5 5

3   Pass
assert(isequal(your_fcn_name('The quick brown fox jumps over the lazy dog'),3.889))

p = 1×9 cell array {'The'} {'quick'} {'brown'} {'fox'} {'jumps'} {'over'} {'the'} {'lazy'} {'dog'} a = 3 5 5 3 5 4 3 4 3

4   Pass
assert(isequal(your_fcn_name('Another one bites the dust'),4.400))

p = 1×5 cell array {'Another'} {'one'} {'bites'} {'the'} {'dust'} a = 7 3 5 3 4

5   Pass
assert(isequal(your_fcn_name('Antidisestablishmentarianism is the longest nonscientific word in the English language'),7.700))

p = 1×10 cell array {'Antidisestablis…'} {'is'} {'the'} {'longest'} {'nonscientific'} {'word'} {'in'} {'the'} {'English'} {'language'} a = 28 2 3 7 13 4 2 3 7 8

6   Pass
assert(isequal(your_fcn_name('I ate pudding'),3.667))

p = 1×3 cell array {'I'} {'ate'} {'pudding'} a = 1 3 7

7   Pass
assert(isequal(your_fcn_name('I hate pudding'),4.000))

p = 1×3 cell array {'I'} {'hate'} {'pudding'} a = 1 4 7

Suggested Problems

More from this Author34