Cody

Solution 1036592

Submitted on 29 Oct 2016
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
str = 'b';n=5 y_correct = 'bbbbb'; assert(isequal(duplicate_char(str,n),y_correct))

n = 5 y = bbbbb

2   Pass
str = 's';n=1 y_correct = 's'; assert(isequal(duplicate_char(str,n),y_correct))

n = 1 y = s

3   Pass
str = 'b';n=10 y_correct = 'bbbbbbbbbb'; assert(isequal(duplicate_char(str,n),y_correct))

n = 10 y = bbbbbbbbbb

4   Fail
str = 'b';n=0 y_correct = ''; assert(isequal(duplicate_char(str,n),y_correct))

n = 0

Undefined function or variable 'then'. Error in duplicate_char (line 2) if n==0 then Error in TestPoint4 (line 3) assert(isequal(duplicate_char(str,n),y_correct))

5   Pass
str = '?';n=2 y_correct = '??'; assert(isequal(duplicate_char(str,n),y_correct))

n = 2 y = ??

Suggested Problems

More from this Author9