Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

home / study / engineering / computer science / computer science questions and answers / Question: There are only one problem that you need to

home / study / engineering / computer science / computer science questions and answers /

Question: There are only one problem that you need to write java programs to solve. You need to write two classes (two java files) that are in the same package (saved in the same location, under the same directory)

1. Bank Service problem (40 pts)

Requirements: a) You need to write two classes for this problem. Name them Accounts and BankService. The associated java files should be Accounts.java and BankService.java. Make sure the two java files are saved at the same location on your computer.

b) The Accounts class should have two attributes/properties checking balance and saving balance. Both are double values. The Accounts should be able to perform multiple actions:

1. Deposit an amount to checking

2. Deposit an amount to saving

3. Withdraw an amount to checking

4. Withdraw an amount to saving

5. Transfer an amount from checking to saving

6. Transfer an amount from saving to checking

7. Get checking balance

8. Get saving balance

9. Print/display receipt

c) The BankService class should contain only a main method. In this main method, the program instantiates / creates a bank account as an object of the class of Accounts with initialized values. It should greet the customer and display a service menu. Then it will take user input for the service choice and transaction amount. Depending on the user service choice, it will perform the transaction and modify the account balances. Lastly, the program should print a receipt, including current date and time, a message that the transaction has been completed successfully, and the ending balances of checking and saving.

For Accounts class - There are Two instance variables: checkingBalance and savingBalance. Constructor to initialize checking and saving balances Methods: creditChecking(), creditSaving(), debitChecking(), debitSaving(), c2sTransfer(), s2cTransfer(), getCBalance(), getSBalance(), displayAccount()

For BankService Class - Create object: an account initialized with checking and saving balance; - Display service menu; - User chooses service; - User input amount; - Switch statement to perform the service. - Display account;

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

Students also viewed these Databases questions

Question

=+8. Why is productivity important?

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago