Cody

# Problem 813. Multiply 2 numbers

Solution 133599

Submitted on 2 Sep 2012 by Amro
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; y =2; y_correct = 2; assert(isequal(round(your_fcn_name(x,y)),y_correct)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, '*')),'sign * forbidden') assert(isempty(strfind(filetext, 'mtimes')),'mtimes forbidden') assert(isempty(strfind(filetext, 'cross')),'cross forbidden') assert(isempty(strfind(filetext, 'prod')),'prod forbidden') assert(isempty(strfind(filetext, 'cumprod'))) assert(isempty(strfind(filetext, 'times'))) assert(isempty(strfind(filetext, 'mldivide'))) assert(isempty(strfind(filetext, 'mrdivide'))) assert(isempty(strfind(filetext, '/')),'/ forbidden') assert(isempty(strfind(filetext, '\'))) assert(isempty(strfind(filetext, '-'))) assert(isempty(strfind(filetext, '^')),'^ forbidden') assert(isempty(strfind(filetext, 'dot'))) assert(isempty(strfind(filetext, '''')),'string forbidden')

{Warning: Function /users/msssystem5/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.} {> In your_fcn_name at 5 In verifyCode>evaluateCode at 189 In verifyCode at 40 In fevalJSON at 14}

2   Pass
%% x = 8; y =25; y_correct = 200; assert(isequal(round(your_fcn_name(x,y)),y_correct)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, '*'))) assert(isempty(strfind(filetext, 'mtimes'))) assert(isempty(strfind(filetext, 'cross'))) assert(isempty(strfind(filetext, 'prod'))) assert(isempty(strfind(filetext, 'cumprod'))) assert(isempty(strfind(filetext, 'times'))) assert(isempty(strfind(filetext, 'dot')))

{Warning: Function /users/msssystem5/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.} {> In your_fcn_name at 5 In verifyCode>evaluateCode at 189 In verifyCode at 40 In fevalJSON at 14}

3   Pass
%% x = 8; y =0; y_correct = 0; assert(isequal(round(your_fcn_name(x,y)),y_correct)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, '*'))) assert(isempty(strfind(filetext, 'mtimes'))) assert(isempty(strfind(filetext, 'cross'))) assert(isempty(strfind(filetext, 'prod'))) assert(isempty(strfind(filetext, 'cumprod'))) assert(isempty(strfind(filetext, 'times'))) assert(isempty(strfind(filetext, 'dot')))

{Warning: Function /users/msssystem5/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.} {> In your_fcn_name at 5 In verifyCode>evaluateCode at 189 In verifyCode at 40 In fevalJSON at 14}

4   Pass
%% x = -148; y =2865; y_correct = -424020; assert(isequal(round(your_fcn_name(x,y)),y_correct)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, '*'))) assert(isempty(strfind(filetext, 'mtimes'))) assert(isempty(strfind(filetext, 'cross'))) assert(isempty(strfind(filetext, 'prod'))) assert(isempty(strfind(filetext, 'cumprod'))) assert(isempty(strfind(filetext, 'times'))) assert(isempty(strfind(filetext, 'dot')))

{Warning: Function /users/msssystem5/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.} {> In your_fcn_name at 5 In verifyCode>evaluateCode at 189 In verifyCode at 40 In fevalJSON at 14}

5   Pass
%% Test 5 : randi!! x = randi([1 58]); y =286.5; y_correct = x*y; assert(abs( your_fcn_name(x,y)-y_correct)<1e-9) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, '*'))) assert(isempty(strfind(filetext, 'mtimes'))) assert(isempty(strfind(filetext, 'cross'))) assert(isempty(strfind(filetext, 'prod'))) assert(isempty(strfind(filetext, 'cumprod'))) assert(isempty(strfind(filetext, 'times'))) assert(isempty(strfind(filetext, 'dot')))

{Warning: Function /users/msssystem5/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.} {> In your_fcn_name at 5 In verifyCode>evaluateCode at 189 In verifyCode at 40 In fevalJSON at 14}

6   Pass
%% Test 6 : randi and pi !! x = randi([14 580]); y = -pi; y_correct = x*y; assert(abs( your_fcn_name(x,y)-y_correct)<1e-9) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, '*'))) assert(isempty(strfind(filetext, 'mtimes'))) assert(isempty(strfind(filetext, 'cross'))) assert(isempty(strfind(filetext, 'prod'))) assert(isempty(strfind(filetext, 'cumprod'))) assert(isempty(strfind(filetext, 'times'))) assert(isempty(strfind(filetext, 'dot'))) assert(isempty(strfind(filetext, 'num2str'))) assert(isempty(strfind(filetext, 'int2str'))) assert(isempty(strfind(filetext, 'dec2bin')))

{Warning: Function /users/msssystem5/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.} {> In your_fcn_name at 5 In verifyCode>evaluateCode at 189 In verifyCode at 40 In fevalJSON at 14}