Project 10 CECS277

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (6 votes)

Please make sure to follow the naming convention for your project. If your project does not run
because of the naming issues, you won’t receive any credit. Project10 will count as 5% towards
the final project.
Project10.zip should include project10 Package and project10.jar
Project10 package will include
CreditCardDemo.java ➔ Client (main method goes in here)
CreditCard.java
AmericanExpressCreditCard.java
DiscoverCreditCard.java
VisaCreditCard.java
CardFactory.java
DiscoverFactory.java
VisaFactory.java
AmericanExpressFactory.java
Assume we have three different credit cards: Visa, Discover, and AmericanExpress
options and all of them implement abstract class CreditCard. You need to instantiate one
of these classes, but you don’t know which of them, it depends on the user. This is a
perfect scenario for the Factory Method design pattern. Please see the UML diagram and
sample output below for details of how to implement this design.
UML DIAGRAM
Sample output:
In CreditCardDemo: You should be creating an instance of CardFactory and based on user input
you will instantiate the right credit card. Values for credit limit and annual Charges is hard coded.
Program is looping until user enters quit.