Cody

Problem 2336. Calendar Matrix

Solution 3160776

Submitted on 11 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
mo = 1; yr = 2014; momat = makeCalendar(mo,yr); momat_correct = [ ... 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0]; assert(isequal(momat,momat_correct))

DayNumberINI = 4 DayNameINI = 'Wed' DayNumberFIN = 6 DayNameFIN = 'Fri' c = Columns 1 through 30 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Columns 31 through 35 28 29 30 31 0 c = 0 5 12 19 26 0 6 13 20 27 0 7 14 21 28 1 8 15 22 29 2 9 16 23 30 3 10 17 24 31 4 11 18 25 0 c = 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0

Output argument "momat" (and maybe others) not assigned during call to "makeCalendar". Error in Test1 (line 3) momat = makeCalendar(mo,yr);

2   Fail
mo = 2; yr = 2015; momat = makeCalendar(mo,yr); momat_correct = [ ... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28]; assert(isequal(momat,momat_correct))

DayNumberINI = 1 DayNameINI = 'Sun' DayNumberFIN = 7 DayNameFIN = 'Sat' c = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 c = 1 8 15 22 2 9 16 23 3 10 17 24 4 11 18 25 5 12 19 26 6 13 20 27 7 14 21 28 c = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

Output argument "momat" (and maybe others) not assigned during call to "makeCalendar". Error in Test2 (line 3) momat = makeCalendar(mo,yr);

3   Fail
mo = 10; yr = 2010; momat = makeCalendar(mo,yr); momat_correct = [ ... 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0 0 0 0 0 0]; assert(isequal(momat,momat_correct))

DayNumberINI = 6 DayNameINI = 'Fri' DayNumberFIN = 1 DayNameFIN = 'Sun' c = Columns 1 through 30 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Columns 31 through 42 26 27 28 29 30 31 0 0 0 0 0 0 c = 0 3 10 17 24 31 0 4 11 18 25 0 0 5 12 19 26 0 0 6 13 20 27 0 0 7 14 21 28 0 1 8 15 22 29 0 2 9 16 23 30 0 c = 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0 0 0 0 0 0

Output argument "momat" (and maybe others) not assigned during call to "makeCalendar". Error in Test3 (line 3) momat = makeCalendar(mo,yr);

4   Fail
mo = 11; yr = 1972; momat = makeCalendar(mo,yr); momat_correct = [0 0 0 1 2 3 4;5 6 7 8 9 10 11;12 13 14 15 16 17 18;19 20 21 22 23 24 25;26 27 28 29 30 0 0]; assert(isequal(momat,momat_correct))

DayNumberINI = 4 DayNameINI = 'Wed' DayNumberFIN = 5 DayNameFIN = 'Thu' c = Columns 1 through 30 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Columns 31 through 35 28 29 30 0 0 c = 0 5 12 19 26 0 6 13 20 27 0 7 14 21 28 1 8 15 22 29 2 9 16 23 30 3 10 17 24 0 4 11 18 25 0 c = 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 0 0

Output argument "momat" (and maybe others) not assigned during call to "makeCalendar". Error in Test4 (line 3) momat = makeCalendar(mo,yr);

Suggested Problems

More from this Author50

Community Treasure Hunt

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

Start Hunting!