7 kyu
Simple Maths Test
1,319 of 3,277sohilpandya
Description:
Create a function which checks a number for three different properties.
- is the number prime?
- is the number even?
- is the number a multiple of 10?
Each should return either true or false, which should be given as an array. Remark: The Haskell variant uses data Property
.
Examples
numberProperty(7) // ==> [true, false, false]
numberProperty(10) // ==> [false, true, true]
The number will always be an integer, either positive or negative. Note that negative numbers cannot be primes, but they can be multiples of 10:
numberProperty(-7) // ==> [false, false, false]
numberProperty(-10) // ==> [false, true, true]
Algorithms
Mathematics
Similar Kata:
Stats:
Created | Mar 16, 2015 |
Published | Mar 16, 2015 |
Warriors Trained | 6538 |
Total Skips | 425 |
Total Code Submissions | 22970 |
Total Times Completed | 3277 |
JavaScript Completions | 1319 |
Haskell Completions | 190 |
Ruby Completions | 405 |
Python Completions | 1128 |
C# Completions | 183 |
Java Completions | 168 |
Total Stars | 74 |
% of votes with a positive feedback rating | 88% of 364 |
Total "Very Satisfied" Votes | 296 |
Total "Somewhat Satisfied" Votes | 51 |
Total "Not Satisfied" Votes | 17 |