Cody

Solution 1375284

Submitted on 10 Dec 2017 by Smith
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))

d = -1

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

d = -1

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

d = -1

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

d = -1

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

d = -1

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

d = -1

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

d = -1

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

d = -1

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

d = -1

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

d = -1

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

d = -1

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

d = -1

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

d = -1

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

d = -1