Cody

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

Solution 3447893

Submitted on 28 Oct 2020
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))

x = 0.3300 m = 0.5000 0.3300 0.2500 0.2000 0.1700 0.1400 0.1300 0.1100 0.6700 0.5000 0.4000 0.3300 0.2900 0.2500 0.2200 0.7500 0.6000 0.5000 0.4300 0.3800 0.3300 0.8000 0.6700 0.5700 0.5000 0.4400 0.8300 0.7100 0.6300 0.5600 0.8600 0.7500 0.6700 0.8800 0.7800 0.8900 ans = 1 3 2 6 3 9

Output argument "y" (and maybe others) not assigned during call to "MixedFraction". Error in Test1 (line 3) assert(isequal(MixedFraction(x),y_correct))

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

x = 0.6600 m = 0.5000 0.3300 0.2500 0.2000 0.1700 0.1400 0.1300 0.1100 0.6700 0.5000 0.4000 0.3300 0.2900 0.2500 0.2200 0.7500 0.6000 0.5000 0.4300 0.3800 0.3300 0.8000 0.6700 0.5700 0.5000 0.4400 0.8300 0.7100 0.6300 0.5600 0.8600 0.7500 0.6700 0.8800 0.7800 0.8900 ans = 0×2 empty double matrix

Output argument "y" (and maybe others) not assigned during call to "MixedFraction". Error in Test2 (line 3) assert(isequal(MixedFraction(x),y_correct))

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

x = 1.3300 m = 0.5000 0.3300 0.2500 0.2000 0.1700 0.1400 0.1300 0.1100 0.6700 0.5000 0.4000 0.3300 0.2900 0.2500 0.2200 0.7500 0.6000 0.5000 0.4300 0.3800 0.3300 0.8000 0.6700 0.5700 0.5000 0.4400 0.8300 0.7100 0.6300 0.5600 0.8600 0.7500 0.6700 0.8800 0.7800 0.8900 ans = 0×2 empty double matrix

Output argument "y" (and maybe others) not assigned during call to "MixedFraction". Error in Test3 (line 3) assert(isequal(MixedFraction(x),y_correct))

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

x = 1.2500 m = 0.5000 0.3300 0.2500 0.2000 0.1700 0.1400 0.1300 0.1100 0.6700 0.5000 0.4000 0.3300 0.2900 0.2500 0.2200 0.7500 0.6000 0.5000 0.4300 0.3800 0.3300 0.8000 0.6700 0.5700 0.5000 0.4400 0.8300 0.7100 0.6300 0.5600 0.8600 0.7500 0.6700 0.8800 0.7800 0.8900 ans = 0×2 empty double matrix

Output argument "y" (and maybe others) not assigned during call to "MixedFraction". Error in Test4 (line 3) assert(isequal(MixedFraction(x),y_correct))

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

x = 1.2800 m = 0.5000 0.3300 0.2500 0.2000 0.1700 0.1400 0.1300 0.1100 0.6700 0.5000 0.4000 0.3300 0.2900 0.2500 0.2200 0.7500 0.6000 0.5000 0.4300 0.3800 0.3300 0.8000 0.6700 0.5700 0.5000 0.4400 0.8300 0.7100 0.6300 0.5600 0.8600 0.7500 0.6700 0.8800 0.7800 0.8900 ans = 0×2 empty double matrix

Output argument "y" (and maybe others) not assigned during call to "MixedFraction". Error in Test5 (line 3) assert(isequal(MixedFraction(x),y_correct))

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

x = 1 m = 0.5000 0.3300 0.2500 0.2000 0.1700 0.1400 0.1300 0.1100 0.6700 0.5000 0.4000 0.3300 0.2900 0.2500 0.2200 0.7500 0.6000 0.5000 0.4300 0.3800 0.3300 0.8000 0.6700 0.5700 0.5000 0.4400 0.8300 0.7100 0.6300 0.5600 0.8600 0.7500 0.6700 0.8800 0.7800 0.8900 ans = 0×2 empty double matrix

Output argument "y" (and maybe others) not assigned during call to "MixedFraction". Error in Test6 (line 3) assert(isequal(MixedFraction(x),y_correct))

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!