Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java programing language pls help me thanks [Q.1] Define an interface BankAccount with the following methods: a. deposit ( double amount) adds an amount

image text in transcribed

in java programing language pls help me thanks

[Q.1] Define an interface BankAccount with the following methods: a. deposit ( double amount) adds an amount to the balance b. withdraw (double amount) subtracts an amount from balance C. getBalance ) returns the balance Then, write the class StandardAccount that implements BankAccount with encapsulated attribute called balance that shows the balance amount in a standard bank account. This class has the following methods: a. transfer ( BankAccount account, double amount) transfers the amount from this object to account object. You should reuse the methods defined above. tostring () returns all the information regarding this account. rite the class CheckingAccount that implements BankAccount with encapsulated b. attributes along with balance: 1. transactionCount which counts how many transactions occurred 2. Constant integer FREE_TRANSACTIONS which is initialized to 3 3. Constant double TRANSACTION FEE which is initialized to 2.0 This class has the following methods: a. transfer ( BankAcco unt account, double amount) transfers the amount from this object to account object. You should reuse the methods defined above deductFees () deduct fees from the balance if the number of transactions exceed the number of free transactions c. toString ( ) returns all the information regarding this account Then, write BankTest class that creates two bank accounts: one for standard account and other for checking account with initial balance $500.00 and $200.00 respectively that have been input from the user. Then, implement the following transactions: Transfer $100.00 from standard account to checking account 2- 1- Deposit $300.00 to checking account 3- Withdraw $500.00 from the standard account 4- Transfer $150.00 from checking account to standard account Deposit-$100.00 to standard account 5- Last, print all the accounts information before your program terminates. Make sure all the double precision formats are correct

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

7. Where Do We Begin?

Answered: 1 week ago