Cody

Solution 1149778

Submitted on 30 Mar 2017
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
x = 'lala'; y_correct = 410; assert(isequal(sumASCII(x),y_correct))

Operands to the || and && operators must be convertible to logical scalar values. Error in sumASCII (line 2) y = sum( x.*( ((x+1)>'A' && (x-1)<'Z') +((x+1)>'a' && (x-1)<'z') ) ) Error in TestPoint1 (line 3) assert(isequal(sumASCII(x),y_correct))

2   Fail
x = 'tralala'; y_correct = 737; assert(isequal(sumASCII(x),y_correct))

Operands to the || and && operators must be convertible to logical scalar values. Error in sumASCII (line 2) y = sum( x.*( ((x+1)>'A' && (x-1)<'Z') +((x+1)>'a' && (x-1)<'z') ) ) Error in TestPoint2 (line 3) assert(isequal(sumASCII(x),y_correct))

3   Fail
x = 'Try this!'; y_correct = 824; assert(isequal(sumASCII(x),y_correct))

Operands to the || and && operators must be convertible to logical scalar values. Error in sumASCII (line 2) y = sum( x.*( ((x+1)>'A' && (x-1)<'Z') +((x+1)>'a' && (x-1)<'z') ) ) Error in TestPoint3 (line 3) assert(isequal(sumASCII(x),y_correct))