Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question deals with an inheritance hierarchy involving a class called Credit Card (you can call it Credit, for short). Every credit card has a

This question deals with an inheritance hierarchy involving a class called Credit Card (you can call it Credit, for short). Every credit card has a 16-digit account number, which you should implement as an array of characters (NOT AS AN int). Credit cards also have a balance, implemented by a float. For every credit card, you can make a purchase, which adds to your balance, or make a payment, which subtracts from your balance. There is also a function that is called once a month named finance, which adds a certain percent of your balance to your balance. This percentage is determined by adding a base rate (which is set when the credit card is issued/created) to the prime rate (which it receives as a parameter). A credit card should also have accessor (get) functions for the account number and balance. There are certain kinds of special Credit Cards that offer rewards for purchases that you make. For example, some of them offer frequent flier miles (1 mile for every dollar of purchase that you make). Your derived class should keep track of how many miles the user currently has. The derived class should also have a function, redeem, that is called when a user redeems his miles for a plane ticket (it receives the amount redeemed as a parameter). Another kind of special credit card is one that gives 2% of all purchases to a charity. Whenever a purchase is made, a value shared by all of this type of credit card is updated. It should also have a function that returns how much was collected for charity by the joint effort of all the users. (Hint: Remember about class members versus instance members) A: Write declaration and implementation (i.e. both .h and .cpp files) of the Base class. No comments are necessary. (15 points) B: Write declaration and implementation (i.e. both .h and .cpp files) for the Derived class that implements the card with frequent flier miles. (15 points) C: Write declaration and implementation (i.e. both the .h and .cpp files) for the Derived class that implements the card that gives 2% of all purchases to charity. (15 points) D: Write a function, not part of any class, which receives a pointer to an instance of credit card, an amount, and a percentage, which is the prime rate. It then applies the amount it receives as a payment to the credit card, and calls the finance function to apply the finance charges. It returns the amount of finance charges that were debited to the account. (15 points)image text in transcribed

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_2

Step: 3

blur-text-image_3

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 Accounting

Authors: Jan Williams, Sue Haka, Mark Bettner, Joseph Carcello

15th Edition

0077328701, 9780077328702

More Books

Students also viewed these Accounting questions

Question

Mortality rate

Answered: 1 week ago

Question

Armed conflicts.

Answered: 1 week ago