Cody

Problem 2431. Power Times (of the day)

Solution 3057631

Submitted on 4 Oct 2020
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
time = '2:38'; y_correct = 1; assert(isequal(power_time(time),y_correct))

out = 1

2   Pass
time = '8:23'; y_correct = 100; assert(isequal(power_time(time),y_correct))

out = 100

3   Pass
time = '3:28'; y_correct = 10; assert(isequal(power_time(time),y_correct))

out = 10

4   Fail
time = '9:23'; y_correct = 1000; assert(isequal(power_time(time),y_correct))

Unrecognized function or variable 'out'. Error in power_time (line 12) out == 1000 Error in Test4 (line 3) assert(isequal(power_time(time),y_correct))

5   Pass
time = '7:22'; y_correct = 0; assert(isequal(power_time(time),y_correct))

6   Fail
time = '1:31'; y_correct = 1001; assert(isequal(power_time(time),y_correct))

out = 1

Assertion failed.

7   Fail
time = '4:22'; y_correct = 1100; assert(isequal(power_time(time),y_correct))

out = 100

Assertion failed.

8   Fail
time = '1:02'; y_correct = 1000; assert(isequal(power_time(time),y_correct))

Unrecognized function or variable 'out'. Error in power_time (line 12) out == 1000 Error in Test8 (line 3) assert(isequal(power_time(time),y_correct))

9   Pass
time = '4:12'; y_correct = 0; assert(isequal(power_time(time),y_correct))

10   Fail
time = '5:15'; y_correct = 1001; assert(isequal(power_time(time),y_correct))

out = 1

Assertion failed.

Community Treasure Hunt

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

Start Hunting!