Cody

Problem 42981. Angle difference between Hour Hand and Minute Hand of clock

Solution 2064117

Submitted on 19 Dec 2019 by Asif Newaz
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
x = '12:00'; y_correct = 0; assert(isequal(AngleDifference(x),y_correct))

new_x = '12:00 PM' Y = 2019 M = 1 D = 1 H = 12 MN = 0 S = 0 ds = 0 dm = 0 dh = 360 theta = 360

2   Pass
x = '14:00'; y_correct = 60; assert(isequal(AngleDifference(x),y_correct))

new_x = ' 2:00 PM' Y = 2019 M = 1 D = 1 H = 14 MN = 0 S = 0 ds = 0 dm = 0 dh = 420 theta = 420

3   Pass
x = '10:10'; y_correct = 115; assert(isequal(AngleDifference(x),y_correct))

new_x = '10:10 AM' Y = 2019 M = 1 D = 1 H = 10 MN = 10 S = 0 ds = 0 dm = 60 dh = 305 theta = 245

4   Pass
x = '23:59'; y_correct = 5.5; assert(isequal(AngleDifference(x),y_correct))

new_x = '11:59 PM' Y = 2019 M = 1 D = 1 H = 23 MN = 59 S = 0 ds = 0 dm = 354 dh = 719.5000 theta = 365.5000

5   Pass
x = '5:30'; y_correct = 15; assert(isequal(AngleDifference(x),y_correct))

new_x = ' 5:30 AM' Y = 2019 M = 1 D = 1 H = 5 MN = 30 S = 0 ds = 0 dm = 180 dh = 165 theta = 15