Cody

Solution 1418344

Submitted on 16 Jan 2018 by Mehedi hasan shuvo
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
filetext = fileread('daysInMonth.m'); assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden') assert(isempty(strfind(filetext, 'if')),'IF statements are forbidden')

2   Pass
m = 1; d_correct = 31; assert(isequal(daysInMonth(m),d_correct))

3   Pass
m = 2; d_correct = 28; assert(isequal(daysInMonth(m),d_correct))

4   Pass
m = 3; d_correct = 31; assert(isequal(daysInMonth(m),d_correct))

5   Pass
m = 4; d_correct = 30; assert(isequal(daysInMonth(m),d_correct))

6   Pass
m = 5; d_correct = 31; assert(isequal(daysInMonth(m),d_correct))

7   Pass
m = 6; d_correct = 30; assert(isequal(daysInMonth(m),d_correct))

8   Pass
m = 7; d_correct = 31; assert(isequal(daysInMonth(m),d_correct))

9   Pass
m = 8; d_correct = 31; assert(isequal(daysInMonth(m),d_correct))

10   Pass
m = 9; d_correct = 30; assert(isequal(daysInMonth(m),d_correct))

11   Pass
m = 10; d_correct = 31; assert(isequal(daysInMonth(m),d_correct))

12   Pass
m = 11; d_correct = 30; assert(isequal(daysInMonth(m),d_correct))

13   Pass
m = 12; d_correct = 31; assert(isequal(daysInMonth(m),d_correct))

14   Pass
m = 13; d_correct = -1; assert(isequal(daysInMonth(m),d_correct))

15   Pass
m = randi([-100 0]); d_correct = -1; assert(isequal(daysInMonth(m),d_correct))

Suggested Problems

More from this Author25