Cody

Solution 1655046

Submitted on 21 Oct 2018 by William
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
% It's going to be a long week a = [2014 8 4 08 00 0]; weekend(a) b = 105; assert(abs(weekend(a)-b)<1e-5)

ans = 105

2   Pass
a = [2014 08 05 10 23 34]; weekend(a) b=78.607222; assert(abs(weekend(a)-b)<1e-5)

ans = 78.6072

3   Pass
% Half way there a = [2014 08 06 13 39 15]; b = 51.3458333; assert(abs(weekend(a)-b)<1e-5)

4   Pass
a = [2014 08 07 23 12 41]; b = 17.788611; assert(abs(weekend(a)-b)<1e-5)

5   Pass
% Counting down the minutes a = [2014 08 08 16 31 59]; b = 0.466944; assert(abs(weekend(a)-b)<1e-5)

6   Pass
a = [2013 08 29 15 59 10]; b = 25.013888; assert(abs(weekend(a)-b)<1e-5)

7   Pass
a = [2013 12 30 09 05 9]; b = 103.914166; assert(abs(weekend(a)-b)<1e-5)

8   Pass
a = [2012 02 27 10 32 33]; b = 102.457500; assert(abs(weekend(a)-b)<1e-5)

9   Pass
% Prohibited functions. List may be added to if more cheats arise t=evalc('type weekend.m'); badwords={'str2num'}; assert(~any(cellfun(@(y) any(strfind(t,y)),badwords)));