Question: 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.

 The exercise for this week is to write a class that

simulates managing a simple bank account. The account is created with an

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, accountNumber to zero, ownerName to an empty string, and the interestRate to zero. Other constructor that takes initial balance, accountNumber, and the ownerName at the time of object creation 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 changes the balance in the account to balance (1+interestRate). displayAccountSummary method should display the accountNumber, ownerName, balance, and the interestRate - The UML diagram for the Account class is shown in the following UML diagram. BankAccount -balance: double -acountNumber: int +doublegetBalance (); +void deposit(double) +void withdraw(double) +void addlnterest) +BankAccount) +BankAccount(double, double, int, string) +displayAccountSummary); The Account Class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!