Your Perfect Assignment is Just a Click Away
We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

C++ Class; #Class, Inheritance, polymorphism and STL

C++ Class; #Class, Inheritance, polymorphism and STL

#Class, Inheritance, polymorphism and STL

1. (15 points). Implement a class called BankAccount.

The class should have the following member variables:

account_number – int

balance – a double that holds the balance on the account

transcations – a vector of double includes all transactions, including deposit (a positive value), withdraw (a negative value) and monthly interest (a positive value).

The class should have 3 constructors (a default constructor, a copy constructor), accessors and mutators functions, a function to return the number of accounts, and deposit and withdraw functions.

a) UML diagram

b) implement the BankAccount.h file.

c) implement the BankAccount.cpp file.

2. (20 points) Consider a class SavingsAccount that is derived from the BankAccount class. The derived SavingsAccount class has an additional member, monthInterestRate, which holds the monthly interest rate for the account. The class has a constructor (calling the base class’s constructor) and a calcInterest function that returns the monthly interest on the account.

a) implement the SavingsAccount.h file

b) implement the SavingsAccount.cpp file

c) Write a main () function that:

· Declares a pointer of BankAccount to refer to an array of 5 SavingsAccount objects.

· Assigns values to the member variables using the mutator functions.

· Print the number of accounts that have been created (call the function you implemented above)

· Prints out the account number and balance of each element of the array using the accessor functions.

· Print the account with the maximal balance.

3. (15 points)

a) define a pure virtual function transfer in the BankAccount class (the question #1), can you still instantiate the BankAccount after adding the pure virtual function? Explain your answer?

void transfer (BankAccount &DestAcc, double transferAmount)

b) implement a transfer function in SavingAccount class to override the above virtual function,

The function should transfer transferAmount from the source account to destAcc.

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: I'm Homework Free only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by I'm Homework Free are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. I'm Homework Free is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At I'm Homework Free, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.