Cody

Problem 2162. Let's get back to school: create mixed numbered fraction

Solution 1873057

Submitted on 13 Jul 2019
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   Fail
x = 1.33; y_correct = [1 1 3]; assert(isequal(MixedFraction(x),y_correct))

y = 1 133 100

Assertion failed.

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

y = 1 83 50

Assertion failed.

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

y = 1 233 100

Assertion failed.

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

y = 1 9 4

Assertion failed.

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

y = 1 57 25

Assertion failed.

6   Fail
x = 2.00; y_correct = [1 5 5]; assert(isequal(MixedFraction(x),y_correct))

y = 1 2 1

Assertion failed.

Suggested Problems

More from this Author25

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!