Cody

Solution 1404405

Submitted on 4 Jan 2018 by Thomas Steffen
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
D = '5-Jan-2018'; y_correct = 1; assert(isequal(Fri(D),y_correct))

d = datetime 05-Jan-2018 h = 0

2   Pass
D = '09/09/2019'; y_correct = 0; assert(isequal(Fri(D),y_correct))

[Warning: Successfully read the date/time text using the format 'MM/dd/uuuu', but their format is ambiguous and could also be 'dd/MM/uuuu'. Specify a format character vector to avoid ambiguity.] d = datetime 09-Sep-2019 h = -612

3   Pass
D = '2000-01-01'; y_correct = 0; assert(isequal(Fri(D),y_correct))

d = datetime 01-Jan-2000 h = 6579

4   Pass
D = '2020-12-25'; y_correct = 1; assert(isequal(Fri(D),y_correct))

d = datetime 25-Dec-2020 h = -1085