Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make a second C# program to demonstrate validation of a pattern with a regular expression. Create a button to act as a credit card verifier

Make a second C# program to demonstrate validation of a pattern with a regular expression.

Create a button to act as a credit card verifier and add a textbox to the form for the user to type a credit card number for validation.

The code for this button should use a Regular Expression to test the value in the textbox. The valid format and range of values is: 4 sets of 4 digits separated by dashes, the leading digit in the first group cannot be 0, the second group of digits are each in the range of 1-3 [they are control numbers indicating the type of card.]

If the credit card number is not in a valid formatgive a message box or message in a label to the user that the number entered is not a valid card number. Otherwise give a message that the credit card number is in a valid format.

Example: 1234-1122-7474-1234 is a valid card number.

222-22-222, 0111-1111-1111-1111, and b123-5555-1111-1111 are not valid card numbers.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions