Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Discuss How do you implement Atomicity and Durability?

Answered: 1 week ago

Question

Discuss about Complex integrity constraints in SQL?

Answered: 1 week ago

Question

Explain about Schema refinement in Database design?

Answered: 1 week ago

Question

Illustrate Concurrent execution of transaction with examples?

Answered: 1 week ago