Java Help (nothing big i promise)



  • Everything is set up and im sure this is a small problem, as all the logic that I added should make it do what I want to do. The only problem is on Main on line 25 it shows an error on "BankAcc" for some reason. The problem wasn't there before. I guess it could be because of the AcctName added. But I have no idea why it would :/

    Anyways here is a link to my program.http://www.megaupload.com/?d=U8XOCU72

    Note*: That will open up in netbeans, if you dont have netbeans the .class files are in "Assignment3\src\assignment3", which you can open in note/wordpad

     If you need more info about this in order to help just ask, i can post it but I think it wouldnt matter in this case. Thanks!



  • Homework?

    "Big" or not, I don't think anybody on this board is particularly inclined to help you complete your homework.



  •  In his defense, he has already done the homework and just asks us for a second opinion (Or so I hope). I've still not enough time to look over it I'm afraid.



  • Oh. Well, I don't know jack about Java. And I clicked the link and couldn't figure out how to download the file. So... I'm a WTF on two counts, at least.



  •  Yeah it is. But in my defense this is all last semesters homework... I'm just trying to finish it so i learn it. I just have a small problem referring one of the classes and was wondering why.

     Also, last time people complained about my post being too complicated, with too much work, and this is a forum for simple fixes to problems. So... that's what I am doing. It shouldnt take more than a minute or two to figure out for experienced java programmers.



  •  You download the file from MU, it's a zip.You extract it. If you have Netbeans open the folder and it should all show up. If not, open the irectory i told you, open each class file at a peice of text, copy and paste to your app.



  • I get an error in the main class. It looks like you only added AcctName in your main function (where you instantiate the BankAccs) but not in the actual class BankAcc. Please check what your error message is actually saying.

    Edit: There seems to be a constructor in the Account class that looks like what you want. Why are you using two different classes "Account" and "BankAcc" anyway?



  • Hmmm, he wants me to "modify CheckingAccount (my bankaccount) class
    again,  to become a simple derived class of the parent class Account. " Seems like I skipped that sentence.... I have no idea how to do that or expect you to tell me.

     

    As of now, I'm just trying to make the program work as is. Your input of the edit gave me an idea, I'll tweak it now on my own and see what I can figure out. Thanks.

     

    If anyone else has input it would be appreciated while I work on this further.



  •  I sent you a PM when you posted your last thread about this.  Check there.  you had a few basic flaws with the structure of this application that were causing you pain.

     

    FYI here's my PM

     

    "you seem to be missing something.  I'm guessing your prof wants you
    to build an object hierarchy... as in... Withdrawal, Deposit and
    ServiceCharge are all types of Transaction.  

     Also, don't put all
    your classes in the same package.  make a model package with the above
    classes.  The model package has absolutely no gui code in it (no joption
    panes.. those classes should have no idea if they are being presented
    on the web or a Swing app).  Then have some 'business objects' or
    'delegates' in another package that are the go-between between your gui
    code and the model objects.  then have gui code... then have a Main with
    only one method: main().  no others.  this will cut back on the amount
    of static methods.. .in the real world you don't see those that often. 
    static methods are typically util methods or factory methods that return
    instances.  

     PM me here with your email if you want to talk
    further.  I refactored a little of your code just to make it compile but
    i have runtime errors."

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.