Description you are writing a program that manipulates bank


Question: Description: You are writing a program that manipulates bank accounts. Each account has a holder's name (string), holder's mobile (string), and balance (pointer to double). There are two types of accounts: checking account and saving account. A saving account is characterized by a "profit rate" data attribute that indicates how much profit the account holder makes every year. The checking account is characterized by the daily withdraw limit.

Using classes and a single tree, write a C/C++ program that manipulates accounts in a binary tree in such a way that all checking accounts are on the left side of the tree root and all saving accounts on the right side of the tree. The trees on each side are sorted so that the account on the left has a balance lower than its parent and the balance of the account on the right side has a balance higher than the balance of the parent. Please note that this does not apply to the main root of the tree because all checking accounts are on its left side and all saving accounts are on its right side whatever the balance is.Also, note that the root of the tree itself is NOT an account held by a customer, it is just a root/separator.

For the accounts classes, define the following:

- Default constructor that sets the balance to 0, the name to "Unknown name", and the mobile to "Unknown mobile".

- A constructor that takes three parameters of the same types as the above attributes and initializes the corresponding attributes.

- A convert/conversion constructor that takes a double and creates a new object with the balance set to this double and the other attributes set to "Unknown name" and "Unknown mobile".

- A convert/conversion operator that allows assigning a bank account to a double.

- A copy constructor.

- The assignment operator.

- The addition (+) operator (this operator applies to all attributes: name, mobile, and balance).

- Overload the input (>>) operator.

For the tree, please define the following:

- Add an account

- Remove an account

- Modify the balance of an account (withdraw and deposit)

- Print all accounts

- Print all saving accounts

- Print all checking accounts

Request for Solution File

Ask an Expert for Answer!!
Physics: Description you are writing a program that manipulates bank
Reference No:- TGS02571635

Expected delivery within 24 Hours