6 kyu

Get angle between hour and minute hands

91 of 157Mishaboo

Description:

Your task is to write a function that accepts string parameter time (Example: "22:17") and returns angle between minute and hour hands on round clock at that time.

The angle measured is the smaller of two angles the two hands may form.

If hours or minutes out of their range return or input is "Invalid input".

For example:

getAngle("15:15"); // 7.5
getAngle("s5:15"); // "Invalid input"
getAngle("error"); // "Invalid input"
get_angle("15:15"); // 7.5
get_angle("s5:15"); // "Invalid input"
get_angle("error"); // "Invalid input"
Fundamentals
Mathematics
Puzzles

Stats:

CreatedNov 18, 2016
PublishedJan 27, 2017
Warriors Trained436
Total Skips53
Total Code Submissions1242
Total Times Completed157
JavaScript Completions91
PHP Completions76
Total Stars12
% of votes with a positive feedback rating91% of 53
Total "Very Satisfied" Votes44
Total "Somewhat Satisfied" Votes8
Total "Not Satisfied" Votes1
Total Rank Assessments9
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Mishaboo Avatar
  • donaldsebleung Avatar
  • Bubbler Avatar
  • ZED.CWT Avatar
Ad