You now have to design the method that reads a record


You have a file that contains credit card records. Each record contains a field for the card number, the expiration date, and the name of the card holder. In your system you have 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 reads a record from the file, verifies that the credit card number is a possible account number, and creates an instance of the appropriate credit card class. What design patterns could you use for that? 

Important details: Credit card numbers cannot exceed 19 digits, including a single check digit in the rightmost position. The exact algorithm for calculating the check digit as defined in ISO 2894/ANSI 4.13 is not important for this assignment. You can also determine the card issuer based on the credit card number:
MasterCard First digit is a 5, second digit is in range 1 through 5 inclusive. Only valid length 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.
Deliverables: 
- Describe what the primary problem you try to solve is. 
- Describe what are the secondary problems you try to solve (if there are any). 
- Describe what design pattern(s) you use how (use plain text and/or UML diagrams). 
- Describe the consequences of using this/these pattern(s).
Hint: you face here (at least) two problems, one has to do with how you figure out what kind of card a specific record is about, the other one with how you create the appropriate objects. Look at behavioural patterns and at creational patterns.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: You now have to design the method that reads a record
Reference No:- TGS0115377

Expected delivery within 24 Hours