Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class called BankAccount. Each Account object should have a name, ID, accountType (Savings, Chequing and TFSA) and amount to be deposited for Initial

Create a class called BankAccount.

Each Account object should have a name, ID, accountType (Savings, Chequing and TFSA) and amount to be deposited for Initial opening of the account. [Hint : accountType can be a String Array].

Create 2 constant values which depict the INTEREST_SAVINGS_YEARLY=2.1% and INTEREST_TFSA_YEARLY=2.3%.

Create a default constructor with empty arguments and a constructor so that it only accepts 2 parameters, i.e., name and amount. Initialize the ID with value between 1 to 1000 using randint() method from the Random Class.

Create Set/Get methods for as required for each field.

Create 2 methods to Deposit and Withdraw money from the account respectively.

Create a Method Yearly_Interest. Depending on the account type, the interest will be different. All must be calculated from one single method.

Create a toString() method to print the values of name, ID, AccountType, amount in the account, interest earned in the year.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Databases On The Web Learn To Create Web Pages That Interface With Database Engines

Authors: Robert Papaj, Donald Burleson

11th Edition

1576100995, 978-1576100998

More Books

Students also viewed these Databases questions

Question

Describe the seven standard parts of a letter.

Answered: 1 week ago

Question

Explain how to develop effective Internet-based messages.

Answered: 1 week ago

Question

Identify the advantages and disadvantages of written messages.

Answered: 1 week ago