Cody

Solution 1195888

Submitted on 23 May 2017 by Karen Yee
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
a = [2.5 -1.7 5.6 8.4] y_correct = [ 2 -2 5 8]; assert(isequal(rounding(a),y_correct)) a = [ -105.25 78.89 -0.1 0.9 7.2]; y_correct = [ -106 78 -1 0 7]; assert(isequal(rounding(a),y_correct)) a = [ 265.25 88.99 -0.1 0.9 7.2] y_correct = [ 265 88 -1 0 7]; assert(isequal(rounding(a),y_correct))

a = 2.5000 -1.7000 5.6000 8.4000 i = 1 y = 2 i = 2 y = 2 -2 i = 3 y = 2 -2 5 i = 4 y = 2 -2 5 8 i = 5 i = 1 y = -106 i = 2 y = -106 78 i = 3 y = -106 78 -1 i = 4 y = -106 78 -1 0 i = 5 y = -106 78 -1 0 7 i = 6 a = 265.2500 88.9900 -0.1000 0.9000 7.2000 i = 1 y = 265 i = 2 y = 265 88 i = 3 y = 265 88 -1 i = 4 y = 265 88 -1 0 i = 5 y = 265 88 -1 0 7 i = 6