Assume you are working as a developer in a bank, and you have been asked to develop a program to validate credit card numbers. Assume also that each credit card number consists of 8 digits. The following method is used to verify that the credit is valid or not: - Starting from the rightmost digit, form the sum of every other digit. For instance, if the credit card number is 43589795, then you form the sum 5 + 7 + 8 + 3 = 23. - Double each of the digits that were not included in the preceding step. Add all digits of the resulting numbers. Considering for example the above credit card number 43589795, doubling the digits starting from the next-to-last one, yields 18 18 10 8. Adding all digits in these values yields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27 - Add the sum of the two preceding steps. If the last digit of the resulting sum is 0, the credit card number is valid; otherwise, it is invalid. In our case, 23 + 27 = 50, so the number is valid.
Assume you are working as a developer in a bank, and you have been asked to develop a program
to validate credit card numbers. Assume also that each credit card number consists of 8 digits. The
following method is used to verify that the credit is valid or not:
- Starting from the rightmost digit, form the sum of every other digit. For instance, if the
credit card number is 43589795, then you form the sum 5 + 7 + 8 + 3 = 23.
- Double each of the digits that were not included in the preceding step. Add all digits of the
resulting numbers. Considering for example the above credit card number 43589795,
doubling the digits starting from the next-to-last one, yields 18 18 10 8. Adding all digits
in these values yields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27
- Add the sum of the two preceding steps. If the last digit of the resulting sum is 0, the credit
card number is valid; otherwise, it is invalid. In our case, 23 + 27 = 50, so the number is
valid.
7. On Private Sub Frm_Your_Id_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
a. Form text: Your id + today’s date
8. Private Sub txtcname_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtcname.Leave
a. Textbox customer name cannot be empty, It must start with an alphabet and must consist of two parts otherwise display message, Invalid name.
9. Private Sub txtcnumber_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtcnumber.Leave
a. Card number length must be numeric and eight digits otherwise display message Invalid card number.
10. Private Sub btnvc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnvc.Clicka. Determine the credit card approved status as “YES” and display age of the card on Approve form. As shown below in the sample output.
Form Approve:
11. Private Sub btnexitapprove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexitapprove.Click
a. Close form (back to previous form )
Form YourId:
12. Private Sub btnreset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnreset.Click
a. Clear all textboxes.
b. Set datetimepicker date as minimum date.
13. Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
a. Close Application
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images