From a1863dcfba35fd275df7bc0b3f8ce3ac7d4416ed Mon Sep 17 00:00:00 2001 From: wakidurrahman Date: Thu, 15 Jun 2023 16:01:58 +0900 Subject: [PATCH] feat: simpleClockAngle --- src/code-challenges/code-challenges-003-010.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/code-challenges/code-challenges-003-010.js diff --git a/src/code-challenges/code-challenges-003-010.js b/src/code-challenges/code-challenges-003-010.js new file mode 100644 index 0000000..ba481a4 --- /dev/null +++ b/src/code-challenges/code-challenges-003-010.js @@ -0,0 +1,14 @@ +/** + * Q003: Simple clock angle + * Problem + * You will be given a number N that represents where the minute hand currently is on a clock. + * Your program should return the angle that is formed by the minute hand and the 12 o'clock mark on the clock. + */ + +function simpleClockAngle(number) { + // we got 6 because 360(degree)/60(minute) = 6; + // 360 represents the full number of a degrees in a circle and + // 60 is the number of minutes on a clock, so dividing these two numbers + // gives us the number of degrees for one minute + return 6 * number; +}