Reference no: EM131316517
The exercise for this week is to write a class that simulates managing a simple bank account. The account is created with an initial balance. It is possible to deposit and withdraw funds, to add interest, and to find out the current balance. This should be implemented in class named Account that includes:
• A default constructor that sets the initial balance to zero.
• A constructor that accepts the initial balance as a parameter.
• A function getBalance that returns the current balance.
• A method deposit for depositing a specified amount.
• A method withdraw for withdrawing a specified amount.
• A method addInterest for adding interest to the account.
The addInterest method takes the interest rate as a parameter and changes the balance in the account to
balance*(1+interestRate).
The UML diagram for the Account class is shown in figure 1.
-balance: double
+Account();
+Account(double);
+double getBalance();
+void deposit(double );
+void withdraw(double);
+void addInterest(double);
Account
Your class must work with the code given below and display the output .
240
450
Lab7.cpp (main)
#include
using namespace std;
#include "Account.h"
int main()
{
Account a1;
Account a2(500);
a1.depost(200);
a2.withdraw(50);
a1.addInterest(0.2);
cout<<a1.getBalance();
cout<<"\n";
cout<<a2.getBalance();
system("pause");
return 0;
}
Preferred stock with an annual dividend
: Preferred Products has issued preferred stock with an annual dividend of $5.90 that will be paid in perpetuity. A. If the discount rate is 10% at what price should the preferred sell? Current price? B. At what price should the stock sell 1 year from ..
|
Write the introduction to your proposal
: Write the introduction to your proposal. Add the three physical development activities that you created in week two into the appropriate room in the template. Make sure to incorporate any instructor feedback
|
How many goods will china gain in seigniorage
: Suppose that Japan (country a) and China (country b) do not have foreigncurrency controls in effect. The total demand for money is always 2,000 goods in Japanand 1,000 goods in China. The fiat money supplies are 100 yen in Japan and 300 RMB in China...
|
Which is a function of pmo project monitoring
: A unique responsibility of the PMO is assessing and elevating enterprise project management ability (competency, capability, and maturity), which is a function of PMO project monitoring
|
Write a class that simulates managing a simple bank account
: Write a class that simulates managing a simple bank account. The account is created with an initial balance. It is possible to deposit and withdraw funds, to add interest, and to find out the current balance.
|
Find the natural frequencies as a function of the mass m
: A plate of mass m, supported by a slender straight beam as shown in the Fig. P5.7, vibrates while sinusoidal force is applied to the center of the plate. Find the natural frequencies as a function of the mass m, flexural rigidity EI of the beam, a..
|
Calculate the binomial interest rate tree
: Assume annual compounding of interest for these problems. Assume 10% annual interest rate volatility. Calculate the binomial interest rate tree using the 2-year on-the-run issue and the 3-year on-the-run issue.
|
Define pm assessment in context of the pmo
: For this assignment, address the following items: Define PM assessment in context of the PMO infrastructure management. Describe the primary domains of encompassing PMO assessment
|
Write program that calculate and prints the monthly paycheck
: Write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the following deductions: Federal Income Tax: 15%.
|