Question: **Code in Java** In your system make the following class structure for the credit cards: a class CreditCard, classes VisaCC, MasterCC, AmExCC that are all

**Code in Java**

In your system make the following class structure for the credit cards: a class CreditCard, classes VisaCC, MasterCC, AmExCC that are all subclasses of CreditCard, you assume more subclasses for other credit card types will be added later on. You now have to design the method(s) (and maybe additional classes) that verifies that the credit card number is a possible account number, and creates an instance of the appropriate credit card class. Knowing that:

MasterCard First digit is a 5, second digit is in range 1 through 5 inclusive. Only valid lenght of number is 16 digits.
Visa First digit is a 4. Length is either 13 or 16 digits.
AmericanExpress First digit is a 3 and second digit a 4 or 7. Length is 15 digits.
Discover First four digits are 6011. Length is 16 digits.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!