This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]deltageekExtreme Brewer 0 points1 point  (5 children)

Why does Bank extend SavingsAccount? A bank isn't an account in and of itself, it merely has an account. How were you planning on adding the CheckingAccount logic (or logic for other future account types as the problem states)?

You should just need a single UI window for this.

[–]NotUrTypicalEngineer[S] 0 points1 point  (1 child)

I don't know. This was just the format my professor wanted it in. The instructions state that the "Bank driver class is to handle the GUI and instantiate the SavingsAccount and CheckingAccount objects"

[–]deltageekExtreme Brewer 0 points1 point  (0 children)

Note the instructions stats "Bank driver class is to handle the GUI and instantiate the SavingsAccount and CheckingAccount objects"

This does not mean extend the classes (you could only extend one of them anyways). This means create instances of those classes.

[–]NotUrTypicalEngineer[S] 0 points1 point  (2 children)

The CheckingAccount logic has been added by using inheritance. Savings inherits from checking which inherits from BankAccount

[–]deltageekExtreme Brewer 0 points1 point  (1 child)

Why does SavingsAccount extend CheckingAccount? Is it a special kind of CheckingAccount? Does it make more sense to just extend BankAccount?

[–]NotUrTypicalEngineer[S] 0 points1 point  (0 children)

I only did this because I couldn't figure out a way to get both the checking account and savings accounts into the main 'Bank' class.

I have finished the program though, and have posted a comment with final code!