Cody

Solution 1515653

Submitted on 4 May 2018 by Peter Sharpe
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 = 3; b= 4; y_correct = 5; assert(abs(hypotenuse(a,b)-y_correct)<0.0001)

y = 5

2   Pass
a = 2; b = pi * 2; y_correct = sqrt(a^2+b^2); assert(abs(hypotenuse(a,b)-y_correct)<0.0001)

y = 6.5938

3   Pass
a = randi(10); b = randi(13); y_correct = sqrt(a^2+b^2); assert(abs(hypotenuse(a,b)-y_correct)<0.0001)

y = 14.1421

4   Pass
user_solution = fileread('hypotenuse.m'); assert(isempty(strfind(user_solution,'^')));

5   Pass
assessFunctionAbsence({'sqrt'}, 'FileName', 'hypotenuse.m');