05 October 2015 7:47:04.492 AM LUHN_PRB FORTRAN90 version Test the LUHN library. CH_IS_DIGIT_TEST CH_IS_DIGIT is TRUE if a character represents a digit. C CH_IS_DIGIT(C) "0" T "1" T "2" T "3" T "4" T "5" T "6" T "7" T "8" T "9" T "X" F "?" F " " F CH_TO_DIGIT_TEST CH_TO_DIGIT: character -> decimal digit C CH_TO_DIGIT(C) "0" 0 "1" 1 "2" 2 "3" 3 "4" 4 "5" 5 "6" 6 "7" 7 "8" 8 "9" 9 "X" -1 "?" -1 " " -1 S_DIGITS_COUNT_TEST S_DIGITS_COUNT counts the digits in a string. We count 7 digits in "34E94-70.6" We count 0 digits in "Not a one!" We count 3 digits in "!8*k >>>> & SEVEN-0.3" S_TO_DIGITS_TEST S_TO_DIGITS: string -> digit vector Test string: "34E94-70.6" Extracted 5 digits: 1: 3 2: 4 3: 9 4: 4 5: 7 Test string: "34E94-70.6" Extracted 7 digits: 1: 3 2: 4 3: 9 4: 4 5: 7 6: 0 7: 6 LUHN_CHECK_DIGIT_CALCULATE_TEST LUHN_CHECK_DIGIT_CALCULATE calculates the check digit for a string of digits Check digit of "7992739871" is 3, expecting 3 Check digit of "9876234510" is 0, expecting 0 Check digit of "246897531" is 9, expecting 9 Check digit of "135798642" is 9, expecting 9 LUHN_IS_VALID_TEST LUHN_IS_VALID determines whether a string with final Luhn check digit is valid. Validity of "79927398713" is T, expecting T Validity of "79924398713" is F, expecting F Validity of "79927398711" is F, expecting F LUHN_PRB Normal end of execution. 05 October 2015 7:47:04.492 AM