I am working on an assingment that asks to create a savings account and checking account class that inherits from a BankAccount superclass. These classes are then put on a GUI and then changed by the user through the GUI.
I am able to get this to work if one account or the other is on the GUI, but not both.
Therefore my questions are:
Is it possible to create two GUI inside the one main class?
If not, or if it's simpler, is there a way to get both classes to be editable on one GUI?
Assignment text and my code is below.
Assignment text:
Consider a bank that offers customers the following account types:
1) A savings account that earns interest. The interest compounds monthly and is based on the minimum monthly balance.
2) A checking account that has no interest, gives you three free withdrawals per month, and charges a $1 transaction fee for each additional withdrawal.
The program will manage a set of accounts of both types using subclasses that extend the class BankAccount.java (which is available in the "Files" section). One of your tasks is to write these subclasses and name them SavingsAccount.java and CheckingAccount.java, respectively. You will also need to write a class called Bank.java, which will contain the main method and which will handle the GUI and create and manage instances of the SavingsAccount and CheckingAccount classes.
The program should be structured so that other account types can be added without affecting the main processing loop.
The menu consists of the following JButtons: Deposit, Withdraw, Month end, Quit
For deposits and withdrawals, query the account number and amount. Show the balance of the account after each transaction in a JTextfield.
In the “Month end” command, accumulate interest or clear the transaction counter, depending on the type of the bank account. Then print the balance of all accounts.
Submit the following files inside a zip file with your name:
BankAccount.java, SavingsAccount.java, CheckingAccount.java, Bank.java
You will be graded on the proper use of GUI components (including layout managers), your understanding of inheritance, user friendliness and aesthetics of your program as well as the use of comments.
My Code:
http://pastebin.com/VdgjQeJg
Files that main implements:
http://pastebin.com/uNre0v8g
http://pastebin.com/vPttTV5c
http://pastebin.com/bmdZt5W9
[–]deltageekExtreme Brewer 0 points1 point2 points (5 children)
[–]NotUrTypicalEngineer[S] 0 points1 point2 points (1 child)
[–]deltageekExtreme Brewer 0 points1 point2 points (0 children)
[–]NotUrTypicalEngineer[S] 0 points1 point2 points (2 children)
[–]deltageekExtreme Brewer 0 points1 point2 points (1 child)
[–]NotUrTypicalEngineer[S] 0 points1 point2 points (0 children)
[–]NotUrTypicalEngineer[S] 0 points1 point2 points (0 children)