simulates managing a simple bank account Solution

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
The UML diagram for the Account class is shown in figure 1.

-balance: double
+double getBalance();
+void deposit(double );
+void withdraw(double);
+void addInterest(double);

Your class must work with the code given below and display the output .

Lab7.cpp (main)
using namespace std;
#include "Account.h"
int main()
Account a1;
Account a2(500);
Powered by