Skip to content

feat: simpleClockAngle #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/code-challenges/code-challenges-003-010.js
Original file line number Diff line number Diff line change
@@ -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;
}