View the step-by-step solution to:

Starting with create a class Bank , this will be the base class in this project. The private data of this class will be vector of bank accounts....

Hi...this assignment is due on Sunday. I need to help to finish it on time. Required files are already attached.

Assignment 13 In this lab assignment, we will work with polymorphism. Starting with create a class Bank , this will be the base class in this project. The private data of this class will be vector of bank accounts. Each bank account will contain the account number (random 4­digit integer), account type (saving or checking), and balance of the account. The base class and Account can be declared as suggested in the follows: enum account_type {saving, checking}; class Account { public: Account (); ~Account(); private: int account_number; account_type type; double balance; class Bank { public: Bank(); ~Bank(); // additional functions as needed virtual void deposit() = 0; virtual void withdraw() = 0; private: vector <Account> bank_accounts; Create 2 other derived classes from the base class called Saving and Checking. Redefine the deposit and withdraw functions for each class as follow: For Saving class when call deposit function, a new amount (can be zero) will be added to the current balance along with the interest from the original balance when call withdraw function, check if the amount is valid (cannot exceed the current balance)
Background image of page 1
For Checking class when call deposit function, a new amount (cannot be zero) will be added to the current balance; a transaction fee will be subtracted from the balance. when call withdraw function, check if the amount is valid (cannot exceed the current balance minus the transaction fee); withdraw the amount and subtract the transaction fee from the balance. When making the bank accounts, the account numbers will be the random 4­digit integers; the initial balances will be the random double value between $0 and $100.00; the account type will be either saving or checking. The interest rate will be 0.01 for all saving accounts. The transaction rate will be $0.50 for all checking account. Start the program by making 5 random accounts. The following is the sample inputs and outputs Select the following options 1. Add new account 2. Deposit to an account 3. Withdraw from an account 4. Print all accounts 5. Quit 4 Account number Type Balance 1123 Saving 23.45 5432 Checking 54.65 7421 Checking 87.34 2376 Saving 65.76 5341 Checking 65.34 Select the following options 1. Add new account 2. Deposit to an account 3. Withdraw from an account 4. Print all accounts 5. Quit 1 Enter account number: 1111 Enter account type: Saving Enter account balance: 123
Background image of page 2
Show entire document
Sign up to view the entire interaction

Top Answer

Hi, PFA!. I have done some changes in... View the full answer

Bank.cpp

/*
* Bank.cpp
*
* Created on: Apr 30, 2016
*
Author: nitinlodhi
*/
#include &quot;Bank.h&quot;
#include &lt;vector&gt;
#include &lt;iomanip&gt;
using namespace std;
vector&lt;Account&gt;...

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online