Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Create an inheritance hierarchy that a bank might use to represent customers’ ba

by | Nov 24, 2021 | Computer and Web Programming : C++ Programming | 0 comments

GET HELP WITH YOUR ESSAY

If you need assistance with writing your essay, our professional Essay Writing Service is here to help!

ORDER THIS OR A SIMILAR PAPER NOW

Create an inheritance hierarchy that a bank might use to represent customers’ bank accounts. All customers at this bank can deposit (i.e., credit) money into their accounts and withdraw (i.e., debit) money from their accounts. More specific types of accounts also exist. Savings accounts, for instance, earn interest on the money they hold. Checking accounts, on the other hand, charge a fee per transaction (i.e., credit or debit).
Create an inheritance hierarchy containing base-class Account and derived classes SavingsAccount and CheckingAccount that inherit from class Account. Base-class Account should include one data member of type double to represent the account balance. The class should provide a constructor that receives an initial balance and uses it to initialize the data member. The constructor should validate the initial balance to ensure that it’s greater than or equal to 0.0. If not, the balance should be set to 0.0 and the constructor should display an error message, indicating that the initial balance was invalid. The class should provide three member functions. Member function credit should add an amount to the current balance. Member function debit should withdraw money from the Account and ensure that the debit amount does not exceed the Account’s balance. If it does, the balance should be left unchanged and the function should print the message “Debit amount exceeded account balance.” Member function getBalance should return the current balance.
Derived-class SavingsAccount should inherit the functionality of an Account, but also include a data member of type double indicating the interest rate (percentage) assigned to the Account. SavingsAccount’s constructor should receive the initial balance, as well as an initial value for the SavingsAccount’s interest rate. SavingsAccount should provide a public member function calculateInterest that returns a double indicating the amount of interest earned by an account. Member function calculateInterest should determine this amount by multiplying the interest rate by the account balance.
Derived-class CheckingAccount should inherit from base-class Account and include an additional data member of type double that represents the fee charged per transaction. CheckingAccount’s constructor should receive the initial balance, as well as a parameter indicating a fee amount. Class CheckingAccount should redefine member functions credit and debit so that they subtract the fee from the account balance whenever either transaction is performed successfully. CheckingAccount’s versions of these functions should invoke the base-class Account version to perform the updates to an account balance. CheckingAccount’s debit function should charge a fee only if money is actually withdrawn (i.e., the debit amount does not exceed the account balance).
After defining the classes in this hierarchy, write a program that creates objects of each class and tests their member functions. Add interest to the SavingsAccount object by first invoking its calculateInterest function, then passing the returned interest amount to the object’s credit function.
Create a vector of Account pointers to SavingsAccount and CheckingAccount objects. For each Account in the vector, allow the user to specify an amount of money to withdraw from the Account using member function debit and an amount of money to deposit into the Account using member function credit. As you process each Account, determine its type. If an Account is a SavingsAccount, calculate the amount of interest owed to the Account using member function calculateInterest, then add the interest to the account balance using member function credit. After processing an Account, print the updated account balance obtained by invoking base-class member function getBalance.

ORDER THIS OR A SIMILAR PAPER NOW

Our Services

Top quality papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university, or professional, and we will assign a writer who has a respective degree.

Professional writers

We have hired a team of professionals who provide expert academic help. Most of them are native speakers and PhD holders who are able to take care of any assignment you need help with.

 

Free Revision

If you feel that we missed something, send the order for a free revision. You will have 10 days to send the order for revision after you receive the final paper. You can either do it on your own after signing in to your personal account or by contacting our support team.

On Time Delivery

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

24/7 Support

Our support agents are available 24/7 and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Original

We use several checkers to make sure that all papers you receive are plagiarism-free. Our editors carefully go through all sources and in-text citations. We also promise full confidentiality in all our services.

 

Pediatric Care

Customer satisfaction has always been one of our basic concerns. If you don’t feel satisfied with our delivered work, you can request for a refund.

 

Authentic Source

We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.

 

Our confidential essay writing service protects your privacy

We cherish your trust and do our best to protect you. Anything that you share with our private essay writing service is never misused as the access to your personal data is very limited. Your payment details and credit card number also fall under strict protection when you buy a custom essay online from us.

    Meet Our Team

    Wondering who’s working behind the scenes of our professional essay writing service? We have over 700 amazing people on our team including developers, QA engineers, designers, managers, HR specialists, marketers, essay writers, and many more. See who takes care of the orders you place.

     

    Super writers

    There are 400+ essay writers from all over the world on our team who go through a 3-step hiring process. We call them super-writers because most of them have master’s degrees; therefore, they know the ins and outs of the discipline in which they specialize.

     

    WOW-support

    Our extra-fast and caring support assistants answer your questions 24/7 and resolve any of your troubles. Our team was even nominated for the 2019 Best Quality Management Team Award by the European Contact Centre & Customer Service.

    If you are looking for a reputable and cheapest college essay writing service or homework help websites for college students to write your essay for you or do your homework, you are at the right place. We have more than 1000 essay writers who can help you write your essays for you. Just fill the order form above to submit your instructions and get an online essay helper or essay writer who can “write my essay for me”. Once you do, you will be happy that you used our essay services instead of any other online essay writing service.

    Talk To Us

    Need any help? Feel free to Send Us a Note

    Email:  support@eliteacademicessays.com