Cody

Solution 2096269

Submitted on 17 Jan 2020 by Rohith PK
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 = 1990; y_correct = 'MCMXC'; assert(isequal(dec2rom(x),y_correct))

temp = 1 k = 100 temp = 9 k = 10 temp = 9 k = 1 temp = 0 k = 0.1000 romStr = 'MCMXC'

2   Pass
x = 2008; y_correct = 'MMVIII'; assert(isequal(dec2rom(x),y_correct))

temp = 2 k = 100 temp = 0 k = 10 temp = 0 k = 1 temp = 8 k = 0.1000 romStr = 'MMVIII'

3   Pass
x = 1666; y_correct = 'MDCLXVI'; assert(isequal(dec2rom(x),y_correct))

temp = 1 k = 100 temp = 6 k = 10 temp = 6 k = 1 temp = 6 k = 0.1000 romStr = 'MDCLXVI'

4   Pass
x = 49; y_correct = 'XLIX'; assert(isequal(dec2rom(x),y_correct))

temp = 0 k = 100 temp = 0 k = 10 temp = 4 k = 1 temp = 9 k = 0.1000 romStr = 'XLIX'

5   Pass
x = 45; y_correct = 'XLV'; assert(isequal(dec2rom(x),y_correct))

temp = 0 k = 100 temp = 0 k = 10 temp = 4 k = 1 temp = 5 k = 0.1000 romStr = 'XLV'

6   Pass
x = 0; y_correct = ''; assert(isempty(dec2rom(x)))

temp = 0 k = 100 temp = 0 k = 10 temp = 0 k = 1 temp = 0 k = 0.1000 romStr = 0×0 empty char array