Cody

Solution 561890

Submitted on 21 Jan 2015 by Michael Cappello
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.33; y_correct = [1 1 3]; assert(isequal(MixedFraction(x),y_correct))

N = 1 D = 3 y = 1 1 3

2   Pass
%% x = 1.66; y_correct = [1 2 3]; assert(isequal(MixedFraction(x),y_correct))

N = 2 D = 3 y = 1 2 3

3   Pass
%% x = 2.33; y_correct = [1 4 3]; assert(isequal(MixedFraction(x),y_correct))

N = 4 D = 3 y = 1 4 3

4   Pass
%% x = 2.25; y_correct = [1 5 4]; assert(isequal(MixedFraction(x),y_correct))

N = 5 D = 4 y = 1 5 4

5   Pass
%% x = 2.28; y_correct = [1 9 7]; assert(isequal(MixedFraction(x),y_correct))

N = 9 D = 7 y = 1 9 7

6   Pass
%% a funny one goes here x = 2.00; y_correct = [1 5 5]; assert(isequal(MixedFraction(x),y_correct))

N = 1 D = 1 y = 1 5 5