Example #1
0
        double cardTypeInterestAmount(string card)
        {
            creditCardType cardType = (creditCardType)Enum.Parse(typeof(creditCardType), card);

            switch (cardType)
            {
            case creditCardType.Visa:
                Visa visaCard = new Visa();
                return(visaCard.GetInterest());

            case creditCardType.MasterCard:
                MasterCard mcCard = new MasterCard();
                return(mcCard.GetInterest());

            case creditCardType.Discover:
                Discover discover = new Discover();
                return(discover.GetInterest());
            }
            return(0.0);
        }
Example #2
0
        double cardTypeInterestAmount(string card)
        {
            creditCardType cardType = (creditCardType)Enum.Parse(typeof(creditCardType), card);

            switch (cardType)
            {
                case creditCardType.Visa:
                    Visa visaCard = new Visa();
                    return visaCard.GetInterest();

                case creditCardType.MasterCard:
                    MasterCard mcCard = new MasterCard();
                    return mcCard.GetInterest();

                case creditCardType.Discover:
                    Discover discover = new Discover();
                    return discover.GetInterest();
            }
            return 0.0;
        }