Cody

Problem 1204. Prime Time

Solution 2880650

Submitted on 26 Aug 2020 by Ramesh Kumar V
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 = clock end %This code written by profile_id 16216018 '

2   Pass
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 = 1.0e+03 * 2.0200 0.0080 0.0260 0.0180 0.0500 0.0415 y = 1.0e+03 * 2.0200 0.0080 0.0260 0.0180 0.0500 0.0415 a = 1.0e+03 * 2.0200 0.0080 0.0260 0.0180 0.0500 0.0415 b = 3041 y_correct = 1.0e+03 * 2.0200 0.0080 0.0260 0.0180 0.0500 0.0415

Suggested Problems

More from this Author80

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!