Cody

# Problem 44479. Friday or not

Solution 1404403

Submitted on 4 Jan 2018
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: The format 'dd/mm/yyyy' contains a field for minute (m) in what appears to be a date portion. You might have intended to use the symbol for month (M) rather than for minute (m). See the datetime.Format property for a complete description of the identifiers used in format character vectors.] d = datetime 09-Jan-2019 00:09:00 h = -369.0063

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

[Warning: The format 'dd/mm/yyyy' contains a field for minute (m) in what appears to be a date portion. You might have intended to use the symbol for month (M) rather than for minute (m). See the datetime.Format property for a complete description of the identifiers used in format character vectors.] [Warning: The format 'yyyy-mm-dd' contains a field for minute (m) in what appears to be a date portion. You might have intended to use the symbol for month (M) rather than for minute (m). See the datetime.Format property for a complete description of the identifiers used in format character vectors.] d = datetime 01-Jan-2000 00:01:00 h = 6.5790e+03

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

[Warning: The format 'dd/mm/yyyy' contains a field for minute (m) in what appears to be a date portion. You might have intended to use the symbol for month (M) rather than for minute (m). See the datetime.Format property for a complete description of the identifiers used in format character vectors.] [Warning: The format 'yyyy-mm-dd' contains a field for minute (m) in what appears to be a date portion. You might have intended to use the symbol for month (M) rather than for minute (m). See the datetime.Format property for a complete description of the identifiers used in format character vectors.] d = datetime 25-Jan-2020 00:12:00 h = -750.0083

Assertion failed.