Closed Thread
Results 1 to 2 of 2

getting sub or function not defined error

  1. #1
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    7

    getting sub or function not defined error

    i have done a programme that generates credit card numbers according to the follow conditions for a class assignment that is due tomorrow

    The account number is a 12-digit number, for example 660530 10 4067. It is generated as follows:
    1. First 6 digits: date of birth of agent (in YYMMDD)
    2. 7th, 8th digits: office code (see table 1)
    3. 9th 11th digits: randomly generated digits (each digit is between 0 and 9 and generated with equal probability)
    4. The last digit is determined so that the account number satisfies the criterion of the Luhn Test
    Luhn Test
    1. Take the 1st, 3rd, and every other odd digits from the right of the account number. Get the sum of these digits and call it s1.
    Example: the 1st, 3rd, digits from the right of the account number 660530 10 4067 are 7, 0, 0, 0, 5, and 6. Thus s1 = 7+0+0+0+5+6 = 18
    2. Take the 2nd, 4th, . and every other even digits from the right of the account number. Multiply each digit by 2. If the product is larger than 9, replace it by adding the two digits, thus forming a sequence of single digits.
    Example: the 2nd, 4th, . digits from the right of the account above are: 6, 4, 1, 3, 0, 6.
    Multiplying each by 2 result in: 12, 8, 2, 6, 0, 12
    Replace any number in the sequence that is larger than 9 by the sum of the two digits (eg: 12 is replaced by 1+2,), we get: 3, 8, 2, 6, 0, 3.
    3. Get the sum of the digits in step 2 and call it s2.
    Example: s2 = 3+8+2+6+0+3 = 22
    4. s1 + s2 must be a multiple of 10

    But i am getting "sub or function not defined"error...i dnt knw where i gone wrong,please help...thanking you in advance.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    15,689

    Re: getting sub or function not defined error

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1