Question: Please help thank you. 1. Define a class with the name CreditCard and the following members: Data Members: a. name: name of account holder b.

Please help thank you.

1. Define a class with the name CreditCard and the following members:

Data Members:

a. name: name of account holder

b. creditLimit: limit of credit amount allowed

c. creditBalance: balance charged on the account

d. interestRate: annual interest rate on creditBalance.

e. accountID: unique 3 digit account ID assigned to each CreditCard

object. Use a static data member to generate this unique account ID

for each CreditCard object created.

f. count: A static data member to track the count of the number of

CreditCard objects created.

Member Functions

g. void charge(double amount): function which applies charge on

CreditCard.

h. void payment(double amount): function which pays an amount

towards the creditBalance.

i. void calculateMonthlyInterest( ): function which calculates the

monthly interest and adds interest to the creditBalance.

j. void displayCreditInfo( ): function which displays the account holder

name, accountID, chargeBalance, creditLimit, interestRate and count

of the number of CreditCard objects created.

NOTE: All data members must be private and no pointers allowed.

2. Define the derived classes PremiumCard and BusinessCard from class CreditCard with the following annual interest rates and credit card charge limits:

const double DEFAULT_INTEREST_RATE_PREMIUM = 0.12;

const double DEFAULT_INTEREST_RATE_BUSINESS = 0.10;

const double PREMIUM_CHARGE_LIMIT = 2000.00;

const double BUSINESS_CHARGE_LIMIT = 5000.00;

If the chargeBalance of the PremiumCard or BusinessCard object exceeds the credit card limit then the following fees will be charged:

const double DEFAULT_FEE_PREMIUM = 150.0; //PremiumCard Fee

const double DEFAULT_FEE_BUSINESS = 50.0; //BusinessCard Fee

Use the following driver to validate your program:

#include

#include

#include "PremiumCard.h"

#include "BusinessCard.h"

using namespace std;

int main()

{

BusinessCard businessCard1("Happy Reading Bookstore LLC");

BusinessCard businessCard2("Triangle Florist LLC");

PremiumCard premiumCard1("Charlie Brown");

PremiumCard premiumCard2("Lucy Van Pelt");

businessCard1.charge(6000);

businessCard2.charge(2500);

premiumCard1.charge(2100);

premiumCard2.charge(250);

businessCard1.calculateMonthlyInterest();

businessCard2.calculateMonthlyInterest();

premiumCard1.calculateMonthlyInterest();

premiumCard2.calculateMonthlyInterest();

cout << "***********************************" << endl;

businessCard1.displayCreditInfo();

businessCard2.displayCreditInfo();

premiumCard1.displayCreditInfo();

premiumCard2.displayCreditInfo();

cout << "***********************************" << endl << endl;

businessCard1.payment(5000);

businessCard2.payment(2500);

premiumCard1.payment(2100);

premiumCard2.payment(290);

cout << "********After Payment ***************" << endl;

businessCard1.displayCreditInfo();

businessCard2.displayCreditInfo();

premiumCard1.displayCreditInfo();

premiumCard2.displayCreditInfo();

cout << "***********************************" << endl << endl;

system("pause");

return 0;

}

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 Programming Questions!