Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create an application composed of two classes: Driver and Account. The Driver will be the starting point of the application and it will display a

Create an application composed of two classes: Driver and Account.
The Driver will be the starting point of the application and it will display a menu as shown below.
Menu
================
1. Deposit
2. Withdraw
3. Add Interest
4. Display
5. Exit
The main method within Driver also needs to instantiate an Account object from the Account class found within the c om.lionbank package.
When the end-user chooses to deposit, prompt for the amount and call the account object's deposit method (passing in the deposit amount). Be sure to update the balance within the object. The withdrawal operation is similar, but you must not allow overdrafts. Simply reject the transaction and return 0. The third option requires no input from the user. Instead, it will apply the Account's internal INTEREST_RATE to the current balance. Display should use either the two "getters" or a toString method to display the internal state of the object.
You must be able to create an Account object with an id and initial balance or with the id only. You may use an id of "123", initial balance of $100 and interest rate of 0.10 for the example below.
Here is an example run:
Menu
=================
1. Deposit
2. Withdraw
3. Add Interest
4. Display
5. Exit
Enter Menu Selection: 1
Amount to deposit: 100
Enter Menu Selection: 2
Amount to withdraw: 50
Here is your money: 50.0
Enter Menu Selection: 3
Interest applied.
Enter Menu Selection: 4
123: Balance: 165.0
Enter Menu Selection: 5
Goodbye!
Initially the balance was $100, after the deposit and withdrawal it should be $150. Apply the generous 10% interest rate and the final balance should be $165.

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

1. Does your voice project confidence? Authority?

Answered: 1 week ago