How much profit the account holder makes every year

Assignment Help Physics
Reference no: EM131776124

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

Reference no: EM131776124

Questions Cloud

Design the program for a pneumatic system : Design the program for a pneumatic system for control by a PLC with the cylinder sequence Aþ, Bþ, B-, A- and an LED indicating.
Business situation that presents a legal and ethical issue : A description of a business situation that presents a legal and ethical issue. The description of the business situation must not exceed two pages
Understand an organization environment : The two segments of the organization's environment are general and specific. Why is it important to understand an organization's environment?
Descriptions of items that require adjusting entries : Descriptions of items that require adjusting entries, The company completed services for a client and immediately
How much profit the account holder makes every year : Description: You are writing a program that manipulates bank accounts. Each account has a holder's name (string), holder's mobile (string), and balance.
Compare and contrast the three different vendors : Compare and contrast the three different vendors. Be sure to consider the services, data solutions, and security features they provide.
Components of the search for competitive advantage : Why innovation and product development are crucial components of the search for competitive advantage?
Does the use of non-military organizations : Does the use of Non-Military Organizations/Agencies enhance or degrade the Nation's War on Terror?
Discuss ultrasound diagnostic equipment divisions : Operating results for the Surgical Instruments and Ultrasound Diagnostic Equipment Divisions

Reviews

Write a Review

Physics Questions & Answers

  Find the gauge pressure at a second point in the line

Find the gauge pressure at a second point in the line 10.6m lower than the first if the pipe diameter at the second point is twice that at the first

  Instant it leaves the ground and begins to rebound

Andy drops a ball from a height of 1.28 m. The ball hits the ground and rebounds to 40 percent of its original height. What is the y-component of the velocity of the ball the instant before it hits the ground? What is the y-component of the velocity ..

  Discuss ways in which batteries and capacitors are similar

A) Discuss the ways in which batteries and capacitors are similar and the ways in which they differ. Find total energy stored in a 10 V, 100 Amp-hr battery.

  What is the electric field with the slab in place

A parallel plate capacitor has a capacitance of 2 µF when the plates are seperated by a vacuum. What is the electric field with the slab in place

  What was your reaction time

You are driving down the road at 60 km/hr when you see a chicken dash out onto the road 23.3 m in front of you. What was your reaction time

  Find the coefficient of performance of the device

The same device can act as both an air conditioner and a heat pump (after all, they do the same thing), what is the coefficient of performance of the device acting as a heat pump

  A particle leaves the origin with a speed

A particle leaves the origin with a speed of 3.3 times 10^6 m/s at 38 degrees to the positive x axis. It moves in a uniform electric field directed along positive y axis. Find Ey such that the particle will cross the x axis at x = 1.5 cm if the parti..

  Determine the work done by the net external force

A water-skier is being pulled by a tow rope attached to a boat. As the driver pushes the throttle forward, the skier accelerates, Determine the work done by the net external force acting on the skier

  What should be the resistance of the element

The heating element of an electric oven is designed to produce 3.1kW of heat when connected to a 240-V source. What should be the resistance of the element?

  Do the atoms behavemost like a simple harmonic oscillator

The potential energy U(r) between any two atoms, when given as a function of the distance between their centers, do the atoms behavemost like a simple harmonic oscillator

  Find the mass of gas-gravitational force of earth exerted on

A container in the shape of a cube 20.0 cm on each edge contains air (with equivalent molar mass 28.9 g/mol) at atmospheric pressure and temperature 330 K. Find (a) the mass of the gas, (b) the gravitational force of the Earth exerted on it, and (c) ..

  Find the velocity of second wagon

After impact, the first wagon is seen to travel in direction as before with a velocity of 3km/h. Find the velocity of second wagon?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd