Cody

Solution 1770013

Submitted on 2 Apr 2019 by Abdelfatah Teamah
  • Size: 7
  • This is the leading solution.
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
x = 1; y1=-1; neg3(neg3(x)); assert(isequal(ans,y1))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint1 (line 3) In solutionTest (line 3)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint1 (line 3) In solutionTest (line 3)]

2   Pass
x=2; y=3; z=4; neg3(x); assert(isequal(ans,2)) neg3(y); assert(isequal(ans,3)) neg3(x); assert(isequal(ans,-2)) neg3(z); assert(isequal(ans,4)) neg3(x); assert(isequal(ans,2)) neg3(z); assert(isequal(ans,-4))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint2 (line 4) In solutionTest (line 5)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint2 (line 6) In solutionTest (line 5)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint2 (line 8) In solutionTest (line 5)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint2 (line 10) In solutionTest (line 5)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint2 (line 12) In solutionTest (line 5)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint2 (line 14) In solutionTest (line 5)]

3   Pass
x=0; y=10; neg3(x); assert(isequal(ans,0)) neg3(x); assert(isequal(ans,0)) neg3(y); assert(isequal(ans,10)) neg3(y); assert(isequal(ans,-10))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint3 (line 3) In solutionTest (line 7)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint3 (line 5) In solutionTest (line 7)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint3 (line 7) In solutionTest (line 7)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In neg3 (line 2) In ScoringEngineTestPoint3 (line 9) In solutionTest (line 7)]