Expert answer:Computer Science Bank Account GUI Application

Expert answer:All instructions and files are attached. I need to create a bank account application in netbeans using java. The project includes using the accounts.txt file with information regarding the accounts needed for the GUI.Help to get this working for me would be appreciated. Thanks ahead of time!
20171207055159304_project_f17.pdf

accounts.txt

Unformatted Attachment Preview

CIS 304 Project (60 points)
Due time/date: before 11:30 AM of Dec. 7
What to turn in: Use Export Project in NetBeans to export your project to a zip file, name it
YourLastName_FirstName_project.zip. Send the file as a single attachment through Blackboard. The
subject of this email is YourLastName_FirstName_project. (3 points)
Note:
• Write your name as a comment line at the beginning of each .java program: 1 point deduction
for each java file without your name at top.
• Besides this documentation, I also provide you a text file, accounts.txt (described below). You
should download this text file into the directory of your Netbeans project for your programs.
Make sure when accessing this text file programmatically, your program uses the file name
without explicitly providing a path (so called relative path). For instance,
File accountFile = new File(“accounts.txt”);
For more information about the absolute path, refer to chapter 18 lecture slides. Failing to use
the relative path loses 4 points.
Suggestions:
1. Start early and start from simple – this is VERY important. For example, begin from the
week when the project is available. As the first step, you construct the GUI but not implement
functions for button clicks.
2. For the give function buttons, you may start to implement the Exit function first, and then the
functions of Deposit, Withdraw, and Transfer To buttons.
3. Always keep a copy of your working code before you implement more requirements.
Requirements in summary:
1) Develop a Java GUI application that reads account information from the provided text file
(accounts.txt), populates all account numbers in a JComboBox, and displays other GUI controls as
shown in Fig. 1 (20 points);
2) Exit button : Quit the application(1 point);
3) Deposit button: Make a deposit to a selected account (12 points);
4) Withdraw button: Make a withdrawal from a selected account (12 points);
5) Transfer To button: Make a transfer from a selected account to a beneficiary account (15 points).
Fig. 1 When the Java program starts
1
Requirements in details:
• GUI in general (20 points)
Once the program starts, it reads all account information from accounts.txt (each row in the file is a
account record and is in the format of accountNumber<>customerName<>openDate<>balance,
where <> is the partition/delimiter between two fields. The openDate is in the format of
year/month/day.) It then fills a JComboBox with all account numbers and shows other GUI controls as
in Fig. 1. Your program must be able to “read” the text file of this format programmatically because
when I test your project, the file content (not the format) will be changed.
When you select an item (account number) from the JComboBox, the corresponding values for
openDate, customerName, and balance will be shown in the three read-only text fields, and the
Deposit, Withdraw, and Transfer To buttons become enabled, see Fig. 2.
Fig. 2 The GUI after selecting an account number from the JComboBox


Exit (1 point)

Clicking this button to close the frame and exit the program.

Instead of using mouse to click the button, pressing Alt + x will also trigger the Exit button.
Deposit (12 points)

(After selecting an account number from the JComboBox), clicking the Deposit button will
popup a window as shown in Fig. 3 asking you to enter a deposit amount for the selected
account. Hint: this dialog window is generated by JOptionPane.showInputDialog().
Fig. 3 Make a deposit

If you enter a non-negative number, such as 100, the amount will be deposited to the account.
See Fig 4 – the balanced is adjusted accordingly. The accounts.txt should also be updated
accordingly.
2
Fig. 4 Balance is updated after a successful deposit

If you clicking Cancel in Fig. 3, nothing will happen to this account.

If an invalid deposit amount is entered in Fig. 3, such as -100 or $100, you will see an error
message as shown in Fig 5.
Hint: this dialog window is generated by JOptionPane. showConfirmDialog().
Fig. 5 A popup window notifies user that a deposit amount is invalid.

Withdraw (12 points)


(After selecting an account from the JComboBox), clicking the Withdraw button will popup a
window as shown in Fig. 6 asking you to enter a withdrawal amount for the selected account.
Fig. 6 Withdraw money
If you enter a non-negative number, such as 100, and if the account balance is sufficient, the
withdrawal will be made from the account successfully. See Fig. 7, the balanced is adjusted.
The accounts.txt file should be updated accordingly as well.
Fig. 7 Balance is updated after a successful withdrawal
3

If you clicking Cancel in Fig. 6, nothing will occur to this account.

If an invalid withdrawal amount is entered in Fig. 6, such as -100 or $100, you will see an error
message as shown in Fig 8.


Fig. 8 A popup window notifies user that a withdrawal amount is invalid.
If a withdrawal amount is greater than the balance, you show an error message and stop the
withdrawal.
Transfer To (15 points)

(After selecting an account from the JComboBox), clicking the Transfer To button will popup a
window as shown in Fig. 10 asking you to enter a beneficiary account number.
Fig. 10 Transfer money to a beneficiary account

If a valid account number (any number existing in the JComboBox) is entered, after click OK
button, a window like Fig. 11 pops up asking for amount to transfer.
Fig. 11 Enter a transfer amount

If a valid amount is entered, and the balance is not less than this amount and sometimes the
sum of this transfer amount and a transfer fee, the transfer will be succeeded as shown in Fig.
12 and 13. The transfer fee is only applied to account with the balance less than $10000 which
is specified in AccountConstants interface (more about AccountConstants see end of this
document).
Fig. 12 A pop window notifies user about the successful transfer.
4
Fig. 13 After the successful transfer, the balance is updated.

If an invalid beneficiary account number (i.e., a number which does not exist in the account
number JComboBox) is entered in Fig. 10, Fig. 14 shows the error message.
Fig. 14 Invalid beneficiary account is entered

If the balance is not sufficient for the transfer amount, Fig. 15 shows the error message.
Fig. 15 Error message when the balance is less than transfer amount

If the balance is not sufficient to cover both transfer amount and transfer fee (when such a fee
applies), Fig. 16 shows the error message.
Fig. 16 Error message when the balance is less than the sum of transfer amount and transfer fee
Requirements for the program design is specified in the next page.
5
Design requirements:
You must have the following five classes (at least 5 points deduction for missing a required class).

AccountConstants – contains two constants, CHECKING_BALANCE_THRESHOLD (value
is 10000) and TRANSFER_FEE (value is 2.0). For this project, the business rule is as follows:
When making a transfer to a beneficiary account, if the balance of the transferring account is less
than CHECKING_BALANCE_THRESHOLD, TRANSFER_FEE is deducted from the balance
after the transfer is made. If the balance is not sufficient to cover both
CHECKING_BALANCE_THRESHOLD and TRANSFER_FEE (if the fee applies), the transfer
should not be made. If the balance of transferring account is not less than
CHECKING_BALANCE_THRESHOLD, TRANSFER_FEE is waived for this transfer.

Account – transferTo() method is abstract. deposit() and withdraw() are not abstract. If you
need, feel free to define other methods, such as getBalance(), in the Account class.
Account
-number: String
-name: String
-openDate:GregorianCalendar
-balance: double
Account(String, String, GregorianCalendar, double)
deposit (double): boolean
withdraw (double): boolean
transferTo(Account, double): int
CheckingAccount
CheckingAccount(String, String, GregorianCalendar, double)
transferTo(Account, double): int

CheckingAccount: extends Account and implements the transferTo method (refer to the above
diagram). The returned value of transferTo method is defined as follows.

return 0: transfer successful and without transfer fee

return 1: transfer successful and with the transfer fee applied

return -1: transfer unsuccessful because balance is less than transfer amount and transfer fee

return -2: transfer unsuccessful because balance is less than transfer amount

AccountUtility – reads accounts.txt file, updates the file, and provides data for other programs.

AccountApp – is the only Java program having the main method. This must be the only file with a
main method. If not, you lose 5 points.
Depending on your design and it’s your decision that you may have more Java programs than those
specified above.
6
901<>2016/7/2<>Zhang San<>1000.0
902<>2016/7/5<>Li Si<>14500.05
003<>2016/7/9<>Hebert Castro<>698.04
904<>2016/7/15<>Sijun Wang<>923.12
905<>2016/7/12<>Alicia Gongalez<>546.11
906<>2016/7/15<>Ming Chen<>4359.04
907<>2016/7/15<>Guang Du<>2958.02
908<>2016/7/15<>Michael Lopez<>1300.06
909<>2016/7/5<>Lily Makki<>1532.89
910<>2016/7/15<>John Anderson<>597.21
911<>2016/7/15<>Si Li<>3949.06
912<>2016/7/16<>Z Ma<>7608.87

Purchase answer to see full
attachment

How it works

  1. Paste your instructions in the instructions box. You can also attach an instructions file
  2. Select the writer category, deadline, education level and review the instructions 
  3. Make a payment for the order to be assignment to a writer
  4.  Download the paper after the writer uploads it 

Will the writer plagiarize my essay?

You will get a plagiarism-free paper and you can get an originality report upon request.

Is this service safe?

All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 20% with the discount code ESSAYHELP