Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This question deals with an inheritance hierarchy involving a class called Credi

ID: 3582587 • Letter: T

Question

This question deals with an inheritance hierarchy involving a class called CreditCard (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 (which is set when the credit card is issued) 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 subclass should keep track of how many miles the user currently has. The subclass should also have information about how many miles you collected, and 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: Use static variables)

A: Write the .h file of the Superclass


B: Write the .h file for the subclass that implements the card with frequent flier miles

C: Write the function purchase, as implemented in the frequent flier miles subclass


D: Write a function, not part of any class, which receives a pointer 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.

Explanation / Answer

ach year, he leaves a considerable amount of cash in the business so that he does nothave to borrow money to keep his business going. @e sells a wide variety of bikes $from tricycles for toddlers to sophisticated racing bikes* and accessories such as helmets, speedometers, bike racks,repair kits, and clothing. Bicycle sales have decreased to account for ?4 percent of revenues. "ccessories such as helmets, bike racks, gloves, and locks amount to another 4 percent. -entalsmake up about A4 percent, and repairs make up the remaining A4 percent.In recent years, he has noted that customers are less likely to purchase the highend road andtriathlon bikes, and are purchasing bikes in the range of 6800 to 6/,000. 9he lowerpriced bikes arealso easier to sell and to keep the inventory moving

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote