Cody

Solution 1907105

Submitted on 21 Aug 2019
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('prime_time.m') assert(isempty(strfind(filetext, 'fopen')))

filetext = 'function y = prime_time(x) y = NaN end %This code written by profile_id 2910147 '

2   Fail
x=123 y = prime_time(x) a=clock b=floor(polyval(a(5:6),60)) if isprime(b) y_correct= y else y_correct = NaN; end assert(isequal(y,y_correct),sprintf('%s%g%s','Time is ',datestr(now,13),', or ',b,' seconds after the hour.'))

x = 123 y = NaN y = NaN a = 1.0e+03 * 2.0190 0.0080 0.0210 0.0070 0.0320 0.0120 b = 1931 y_correct = NaN

Time is 487:32:12, or 1931 seconds after the hour.

Suggested Problems

More from this Author80