Credit card companies typically assign a special digit, called a check digit, to the end of each

Question:

Credit card companies typically assign a special digit, called a check digit, to the end of each customer’s credit card number. The check digit allows companies to verify that the credit card number was entered accurately. Many methods for creating the check digit have been developed, including the one you will use in this exercise. Create an application, using the following names for the solution and project, respectively: Merryweather Solution and Merryweather Project. Save the application in the VB2015\Chap08 folder. Create the interface shown in Figure 8-41. Make the Verify button the default button. The interface provides a text box for entering a five digit credit card number, with the fifth digit being the check digit. The btnVerify_Click procedure should use the method shown and illustrated in Figure 8-42 to verify the credit card number. It should then display a message indicating whether the credit card number is valid or invalid. For example, if the user enters 18531 as the credit card number, the application should indicate that the credit card number is valid. However, if the user enters 1853 followed by either the number 0 or any number from 2 through 9, the application should indicate that the credit card number is not valid. Test the application appropriately.

Figure 8-41

Check Digit Algorithm 1. Multiply the second and fourth digits in the credit card number by 2. 2. If multiplying a digit by 2 results in a two-dight number, add both digits together. 3. Add the results of Steps 1 and 2 to the first and third digits in the

Figure 8-42

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question
Question Posted: