Cody

# Problem 42316. Fraction of a fraction of a ...

Solution 686847

Submitted on 14 Jun 2015
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
%% frac_str = 'two-sevenths of five-ninths of three-eighths of 168'; assert(isequal(round(fraction_of_a(frac_str)),10))

Undefined function 'find_meaning' for input arguments of type 'char'.

2   Fail
%% frac_str = 'one-fifth of four-halfs of three-fourths of 100'; assert(isequal(round(fraction_of_a(frac_str)),30))

Undefined function 'find_meaning' for input arguments of type 'char'.

3   Fail
%% frac_str = 'two-thirds of three-fourths of one-fifth of 150'; assert(isequal(round(fraction_of_a(frac_str)),15))

Undefined function 'find_meaning' for input arguments of type 'char'.

4   Fail
%% frac_str = 'five-sevenths of four-fifths of three-halfs of two-sixths of one-fourth of 210'; assert(isequal(round(fraction_of_a(frac_str)),15))

Undefined function 'find_meaning' for input arguments of type 'char'.

5   Fail
%% frac_str = 'one-seventh of two-ninths of 630'; assert(isequal(round(fraction_of_a(frac_str)),20))

Undefined function 'find_meaning' for input arguments of type 'char'.

6   Fail
%% frac_str = 'one-half of three-fifths of two-thirds of three-fourths of 1000'; assert(isequal(round(fraction_of_a(frac_str)),150))

Undefined function 'find_meaning' for input arguments of type 'char'.

7   Fail
%% frac_str = 'one-half of two-thirds of three-fourths of four-fifths of five-sixths of six-sevenths of seven-eighths of eight-ninths of 36288'; assert(isequal(round(fraction_of_a(frac_str)),4032))

Undefined function 'find_meaning' for input arguments of type 'char'.

8   Fail
%% frac_str = 'one-ninth of two-eighths of three-sevenths of four-sixths of five-fifths of six-fourths of seven-thirds of eight-halfs of 36288'; assert(isequal(round(fraction_of_a(frac_str)),4032))

Undefined function 'find_meaning' for input arguments of type 'char'.

9   Fail
%% ind = randi(4); switch ind case 1 frac_str = 'two-sevenths of five-ninths of three-eighths of 168'; assert(isequal(round(fraction_of_a(frac_str)),10)) case 2 frac_str = 'one-fifth of four-halfs of three-fourths of 100'; assert(isequal(round(fraction_of_a(frac_str)),30)) case 3 frac_str = 'two-thirds of three-fourths of one-fifth of 150'; assert(isequal(round(fraction_of_a(frac_str)),15)) case 4 frac_str = 'one-ninth of two-eighths of three-sevenths of four-sixths of five-fifths of six-fourths of seven-thirds of eight-halfs of 36288'; assert(isequal(round(fraction_of_a(frac_str)),4032)) end

Undefined function 'find_meaning' for input arguments of type 'char'.

10   Fail
%% ind = randi(4); switch ind case 1 frac_str = 'one-half of two-thirds of three-fourths of four-fifths of five-sixths of six-sevenths of seven-eighths of eight-ninths of 36288'; assert(isequal(round(fraction_of_a(frac_str)),4032)) case 2 frac_str = 'one-fifth of four-halfs of three-fourths of 100'; assert(isequal(round(fraction_of_a(frac_str)),30)) case 3 frac_str = 'one-seventh of two-ninths of 630'; assert(isequal(round(fraction_of_a(frac_str)),20)) case 4 frac_str = 'two-thirds of three-fourths of one-fifth of 150'; assert(isequal(round(fraction_of_a(frac_str)),15)) end

Undefined function 'find_meaning' for input arguments of type 'char'.

11   Fail
%% ind = randi(4); switch ind case 1 frac_str = 'one-fifth of four-halfs of three-fourths of 100'; assert(isequal(round(fraction_of_a(frac_str)),30)) case 2 frac_str = 'two-sevenths of five-ninths of three-eighths of 168'; assert(isequal(round(fraction_of_a(frac_str)),10)) case 3 frac_str = 'one-half of two-thirds of three-fourths of four-fifths of five-sixths of six-sevenths of seven-eighths of eight-ninths of 36288'; assert(isequal(round(fraction_of_a(frac_str)),4032)) case 4 frac_str = 'one-seventh of two-ninths of 630'; assert(isequal(round(fraction_of_a(frac_str)),20)) end

Undefined function 'find_meaning' for input arguments of type 'char'.

### Community Treasure Hunt

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

Start Hunting!