Last active
April 8, 2018 02:28
-
-
Save jasondew/5050066 to your computer and use it in GitHub Desktop.
Luhn Checksum project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Luhn Checksum | |
http://en.wikipedia.org/wiki/Luhn_algorithm | |
Implement a Ruby program that outputs the validity of a number by applying the Luhn Checksum. | |
Input: | |
The program should accept a single number to validate. | |
Output: | |
The program should output the input along with the validity of the number. | |
Examples: | |
With an input of 79927398713 the output would be: | |
79927398713 is valid. | |
With an input of 79927398710 the output would be: | |
79927398710 is not valid. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment