The following algorithm is widely used for checking whether a
credit or debit card number has been entered correctly on a
website. It doesn't guarantee that the credit card number belongs
to a valid card, but it rules out numbers which are definitely not
valid. Here are the steps:
Check that the long number has exactly 16 digits. If not, the
long number is not valid.
If the long number has 16 digits, drop the last digit from the
long...