Cody

Solution 511326

Submitted on 10 Oct 2014 by James
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
%% year = 2014; day = 'Sun' y_correct = 4; assert(isequal(dd(year,day),y_correct))

day = Sun s = 0 0 0 0 0 0 0 0 0 0 0 0 s = 0 0 0 0 0 0 0 0 0 0 0 0 s = 0 0 0 0 0 0 0 0 0 0 0 0 s = 0 0 1 0 0 0 0 0 0 0 0 0 s = 0 0 1 0 0 0 0 0 0 0 0 0 s = 0 0 1 0 0 0 0 0 0 0 0 0 s = 0 0 1 0 0 1 0 0 0 0 0 0 s = 0 0 1 0 0 1 0 0 0 0 0 0 s = 0 0 1 0 0 1 0 1 0 0 0 0 s = 0 0 1 0 0 1 0 1 0 0 0 0 s = 0 0 1 0 0 1 0 1 0 0 0 0 s = 0 0 1 0 0 1 0 1 0 0 1 0 s = 0 0 1 0 0 1 0 1 0 0 1 0 ans = 4

2   Pass
%% year = 2014; day = 'Wed' y_correct = 5; assert(isequal(dd(year,day),y_correct))

day = Wed s = 0 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 1 0 0 0 0 0 s = 1 0 0 1 0 0 1 0 0 0 0 0 s = 1 0 0 1 0 0 1 0 0 0 0 0 s = 1 0 0 1 0 0 1 0 0 1 0 0 s = 1 0 0 1 0 0 1 0 0 1 0 0 s = 1 0 0 1 0 0 1 0 0 1 0 1 ans = 5

3   Pass
%% year = 1999; day = 'Sun' y_correct = 4; assert(isequal(dd(year,day),y_correct))

day = Sun s = 0 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 1 0 0 0 0 0 0 0 s = 1 0 0 0 1 0 0 0 0 0 0 0 s = 1 0 0 0 1 0 0 0 0 0 0 0 s = 1 0 0 0 1 0 0 1 0 0 0 0 s = 1 0 0 0 1 0 0 1 0 0 0 0 s = 1 0 0 0 1 0 0 1 0 1 0 0 s = 1 0 0 0 1 0 0 1 0 1 0 0 s = 1 0 0 0 1 0 0 1 0 1 0 0 ans = 4

4   Pass
%% year = 1999; day = 'Fri' y_correct = 5; assert(isequal(dd(year,day),y_correct))

day = Fri s = 0 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 1 0 0 0 0 0 s = 1 0 0 1 0 0 1 0 0 0 0 0 s = 1 0 0 1 0 0 1 0 0 0 0 0 s = 1 0 0 1 0 0 1 0 0 1 0 0 s = 1 0 0 1 0 0 1 0 0 1 0 0 s = 1 0 0 1 0 0 1 0 0 1 0 1 ans = 5

5   Pass
%% year = 2004; day = 'Sun' y_correct = 4; assert(isequal(dd(year,day),y_correct))

day = Sun s = 0 0 0 0 0 0 0 0 0 0 0 0 s = 0 0 0 0 0 0 0 0 0 0 0 0 s = 0 1 0 0 0 0 0 0 0 0 0 0 s = 0 1 0 0 0 0 0 0 0 0 0 0 s = 0 1 0 0 0 0 0 0 0 0 0 0 s = 0 1 0 0 1 0 0 0 0 0 0 0 s = 0 1 0 0 1 0 0 0 0 0 0 0 s = 0 1 0 0 1 0 0 0 0 0 0 0 s = 0 1 0 0 1 0 0 1 0 0 0 0 s = 0 1 0 0 1 0 0 1 0 0 0 0 s = 0 1 0 0 1 0 0 1 0 1 0 0 s = 0 1 0 0 1 0 0 1 0 1 0 0 s = 0 1 0 0 1 0 0 1 0 1 0 0 ans = 4

6   Pass
%% year = 2000; day = 'Sat' y_correct = 5; assert(isequal(dd(year,day),y_correct))

day = Sat s = 0 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 0 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 0 0 0 0 0 0 s = 1 0 0 1 0 0 1 0 0 0 0 0 s = 1 0 0 1 0 0 1 0 0 0 0 0 s = 1 0 0 1 0 0 1 0 1 0 0 0 s = 1 0 0 1 0 0 1 0 1 0 0 0 s = 1 0 0 1 0 0 1 0 1 0 0 0 s = 1 0 0 1 0 0 1 0 1 0 0 1 ans = 5

Suggested Problems

More from this Author45