Write a class that simulates managing a simple bank


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).

Your class must work with the code given below and display the output .
240
450 
#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<cout<<"n";
cout<system("pause");
return 0;
}  

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a class that simulates managing a simple bank
Reference No:- TGS087272

Expected delivery within 24 Hours