Credit card companies typically assign a special digit, called a check digit, to the end of each customer’s credit card number. Many methods for creating the check digit have been developed. One simple method is to multiply every other digit in the credit card number by two. You then add the products to the remaining digits to get the total. Finally, you take the last digit in the total and append it to the end of the credit card number, as illustrated in Figure 8-41. Create a Visual Basic Windows application. Use the following names for the solution, project, and form file, respectively: Georgetown Solution, Georgetown Project, and Main Form.vb. Save the application in the VB2010\Chap08 folder. Create the interface shown in Figure 8-42. The interface allows the user to enter a five-digit credit card number, with the fifth digit being the check digit. The Verify button’s Click event procedure should use the method illustrated in Figure 8-41 to verify that the credit card number is valid. The procedure should display appropriate messages indicating whether the credit card number is valid or invalid. Code the procedure. Save the solution and then start and test the application. Close the Code Editor window and then close the solution.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here