Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Physics Expert

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

Physics, Academics

  • Category:- Physics
  • Reference No.:- M92584806

Have any Question?


Related Questions in Physics

The wind blows with a speed of 319 ms over the roof of your

The wind blows with a speed of 31.9 m/s over the roof of your house. Assuming the air inside the house is relatively stagnant, what is the pressure difference at the roof between the inside air and the outside air? Answe ...

Question an object is 40 cm in front of a concave mirror

Question: An object is 40 cm in front of a concave mirror with a focal length of 20 cm. Use ray tracing to locate the image. Is the image upright or inverted? The response must be typed, single spaced, must be in times n ...

Question a particle of charge 505nc is placed at the origin

Question: A particle of charge 5.05nC is placed at the origin of an xy-coordinate system, and a second particle of charge -2.04nC is placed on the positive x-axis at x= 4.04cm . A third particle, of charge 6.00nC is now ...

Question part a the electric potential along the x-axis is

Question: Part A: The electric potential along the x-axis is V =200x2V, where x is in meters. What is Ex at x =0m? Express your answer as an integer and include the appropriate units. Part B: What is Ex at x =3m? Express ...

Question a sump pump used to drain water from the basement

Question: A sump pump (used to drain water from the basement of houses built below the water table) is draining a flooded basement at the rate of 0.55 L/s, with an output pressure of 2.9 Ã- 105 N/m2. a) The water enters ...

Question six artificial satellites complete one circular

Question: Six artificial satellites complete one circular orbit around a space station in the same amount of time. Each satellite has mass m and radius of orbit L. The satellites fire rockets that provide the force neede ...

Question a parallel-plate air capacitor has a capacitance

Question: A parallel-plate air capacitor has a capacitance of 920 pF. The charge on each plate is 2.55 µC. (a) What is the potential difference between the plates? (b) If the charge is kept constant, what will be the po ...

Question a pendulum on mars a certain simple pendulum has a

Question: A Pendulum on Mars. A certain simple pendulum has a period on the earth of 1.65 s. What is its period on the surface of Mars, where g = 3.71 m/s 2 ? The response must be typed, single spaced, must be in times n ...

An oil film n 148 floating on water n 133 is illuminated

An oil film (n = 1.48) floating on water (n = 1.33) is illuminated by white light at normal incidence. The film is 274 nm thick. The reflected light will be predominately a single color. Find the wavelength of the domina ...

Question a student standing in a canyon yells echo and her

Question: A student standing in a canyon yells "echo," and her voice produces a sound wave of frequency of f = 0.56 kHz. The echo takes t = 3.5s to return to the student. Assume the speed of sound through the atmosphere ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As