Cody

Problem 45991. Find the position of planet in solarsystem

Solution 2993752

Submitted on 26 Sep 2020 by Benjamin
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 = 'earth'; y_correct = 3; assert(isequal(nthplanet(x),y_correct))

2   Pass
x = 'Neptune'; y_correct = 8; assert(isequal(nthplanet(x),y_correct))

3   Pass
x = 'MeRcUrY'; y_correct = 1; assert(isequal(nthplanet(x),y_correct))

4   Pass
x = 'SATURN'; y_correct = 6; assert(isequal(nthplanet(x),y_correct))

5   Pass
x = 'URAnus'; y_correct = 7; assert(isequal(nthplanet(x),y_correct))

6   Pass
x = 'MarS'; y_correct = 4; assert(isequal(nthplanet(x),y_correct))

Suggested Problems

Community Treasure Hunt

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

Start Hunting!